Code Comments
Programming Forum and web based access to our favorite programming groups.if iuse findexecutabl3 with a 4 letter extension iget a no extention found error. however I can double click the filename with the four letter extension and all works? What am I doing wrong? *** Sent via Developersdex http://www.examnotes.net ***
Post Follow-up to this messageJim simons wrote: > if iuse findexecutabl3 with a 4 letter extension iget a no extention > found error. however I can double click the filename with the four > letter extension and all works? OK, I'll bite - what the hell is "findexecutabe"? (Or even "findexecutabl3" - I assume that that is the l33t version or the first? -- Regards, Michael Cole
Post Follow-up to this messageMichael Cole wrote: > Jim simons wrote: > > OK, I'll bite - what the hell is "findexecutabe"? http://msdn.microsoft.com/library/d...dexecutable.asp > (Or even "findexecutabl3" - I assume that that is the l33t version or the > first? <g> -- Working without a .NET? http://classicvb.org/
Post Follow-up to this messageJim simons wrote: > if iuse findexecutabl3 with a 4 letter extension iget a no extention > found error. however I can double click the filename with the four > letter extension and all works? > > What am I doing wrong? Well, without an actual example, all we can do is guess. Were you aware that call requires a complete filename, not just an extension? -- Working without a .NET? http://classicvb.org/
Post Follow-up to this messageJim simons wrote: > if iuse findexecutabl3 with a 4 letter extension iget a no extention > found error. however I can double click the filename with the four > letter extension and all works? > > What am I doing wrong? Possibly nothing. I don't have any 4-letter extensions set up with associations here. It's possible that's a bug? Here's another routine that will show how to extract the association from the registry, if that's the case: Public Function FindExtAssociation(ByVal Extension As String) As String Dim DocType As String Dim OpenCommand As String Const HKCR As Long = &H80000000 ' Default value for .ext key is document type DocType = FindExtDoctype(Extension) If Len(DocType) Then ' Drill down to get command used to open this extension. DocType = DocType & "\shell\open\command" OpenCommand = RegGetStringValue(HKCR, DocType, "*") ' If this starts with quotes, extract up to 2nd quote. ' Ex: "C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe" "%1" If InStr(OpenCommand, """") = 1 Then OpenCommand = Mid$(OpenCommand, 2) End If If InStr(OpenCommand, """") > 1 Then OpenCommand = Left$(OpenCommand, InStr(OpenCommand, """") - 1) End If End If ' Return results FindExtAssociation = OpenCommand End Function Public Function FindExtDoctype(ByVal Extension As String) As String Const HKCR As Long = &H80000000 ' Make sure extension starts with a dot. If InStr(Extension, ".") <> 1 Then Extension = "." & Extension ' Default value for .ext key is document type FindExtDoctype = RegGetStringValue(HKCR, Extension, "*") End Function Note, you'll need your own RegGetStringValue function (but _everyone_ has those, right? <g> ). -- Working without a .NET? http://classicvb.org/
Post Follow-up to this message"Jim simons" <jasimons@finaocorp.com> wrote in message news:eD1g0zsIGHA.1388@TK2MSFTNGP11.phx.gbl... > > if iuse findexecutabl3 with a 4 letter extension iget a no extention > found error. however I can double click the filename with the four > letter extension and all works? So ShellExecute the document and be done with it. Why do you care where the executable is? > > What am I doing wrong? > > > *** Sent via Developersdex http://www.examnotes.net ***
Post Follow-up to this messageDavid J Mark wrote: > "Jim simons" <jasimons@finaocorp.com> wrote... > > So ShellExecute the document and be done with it. Why do you care > where the executable is? One common reason would be to discover what version it is, particularly if you're generating the intended document. -- Working without a .NET? http://classicvb.org/
Post Follow-up to this messageI thought I might have to walk to the registry tree I was trying to avoid it. Thanks for the snippet. To the other questions. I need to launch the application and wait for it to finish and then continue on with the rest of the code. FindExecutable works fine with three letter extensions and 4 letter than are built it (.html) I created an extension .abcd and associated it with the application I wanted it to load and it always failed with error 31 (no association) i did the same test with extension .abc and all works fine. I thought I may have missed a resitry setting somewhere when I used my association code. Thanks for the quick replys. *** Sent via Developersdex http://www.examnotes.net ***
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.