Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

findexecutabe and 4letter extension
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 ***

Report this thread to moderator Post Follow-up to this message
Old Post
Jim simons
01-26-06 11:56 PM


Re: findexecutabe and 4letter extension
Jim 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



Report this thread to moderator Post Follow-up to this message
Old Post
Michael Cole
01-26-06 11:56 PM


Re: findexecutabe and 4letter extension
Michael 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/



Report this thread to moderator Post Follow-up to this message
Old Post
Karl E. Peterson
01-26-06 11:56 PM


Re: findexecutabe and 4letter extension
Jim 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/



Report this thread to moderator Post Follow-up to this message
Old Post
Karl E. Peterson
01-26-06 11:56 PM


Re: findexecutabe and 4letter extension
Jim 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/



Report this thread to moderator Post Follow-up to this message
Old Post
Karl E. Peterson
01-26-06 11:56 PM


Re: findexecutabe and 4letter extension
"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 ***



Report this thread to moderator Post Follow-up to this message
Old Post
David J Mark
01-26-06 11:56 PM


Re: findexecutabe and 4letter extension
David 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/



Report this thread to moderator Post Follow-up to this message
Old Post
Karl E. Peterson
01-27-06 02:55 AM


Re: findexecutabe and 4letter extension
I 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 ***

Report this thread to moderator Post Follow-up to this message
Old Post
Jim
01-27-06 11:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:12 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.