Using WINAPI 3.1 call FindExecutable on Windows 3.1 
Author Message
 Using WINAPI 3.1 call FindExecutable on Windows 3.1

Greetings all,

First off, the products that I work on are used in schools and libraries so
we have a lot of customers on very old platforms. This forces us to use VB4
16-bit and remain compatible with Windows 3.1.

Here is the issue: We are adding the ability (have added actually), to click
on a URL and automatically launch their web browser. After wandering around
looking at the 3.1 API stuff I found the API function FindExecutable. I pass
this the name of a dummy HTML file we ship with and it hands back the path
of web browser. Sweet!

The problem: Though this is defined as a Windows 3.1 API call, I get an
"Unable to locate file" error, when I try this on a Windows 3.1 system (It
works like a champ on the Windows 95/98/NT). Any ideas where I am going
astray on this?

Please copy your reply to my E-mail address so I cam be sure I get the
response. Thanks!

Here is a snippet of the code I am doing this with:

... Public declarations ...

    Public Declare Function FindExecutable Lib "Shell" ( _
           ByVal lpFile As String, _
           ByVal lpDirectory As String, _
           ByVal lpResult As String) _
           As Long

... During our MDI Form load ...

    'Find the default web browser and save it's location (if present).
    On Error Resume Next
    '''The above statement is used because contrary to 3.1 API
documentation,
    '''we cannot get FindExecutable to run on a Windows 3.1 system. Dan
1/14/99
    psWebPath = ""
    slpFile = "sirsgov.htm"
    slpDir = TrimTrailingBackslash(App.Path) & "\"
    lRetVal = FindExecutable(slpFile, slpDir, slpResult)
    DoEvents
    If lRetVal = 0 Or IsEmpty(slpFile) Or Err.Number > 0 Then
        psWebPath = ""
        'No browser, no web access...
        pbAllowWeb = False
    Else
        psWebPath = CleanPath(slpResult)
    End If

Dan Rhea
SIRS Mandarin, Inc.

http://www.*-*-*.com/



Tue, 17 Jul 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Netware 3.1 , Windows 3.1 and VB

2. Windows 3.1 networking API calls

3. Windows 3.1 API SpoolFile Call

4. Problem: Win 3.1 crashes with PB 3.1 programs

5. Using MS Windows 3.1 common dialogs DLL from MS Access

6. Using MS Windows 3.1 common dialogs DLL from MS Access

7. Using MS Windows 3.1 common dialogs DLL from MS Access

8. Visual Basic 5.0 using windows 3.1 (Win32s)

9. Using MS Windows 3.1 common dialogs DLL from MS Access

10. Stretchblt() problems using VB3.0 and windows (3.1, 3.11, win95)

11. Remote Automation : Windows 3.1 client/ Windows NT Server

12. Newbie: VB4, Windows 95 platform, Windows 3.1 target

 

 
Powered by phpBB® Forum Software