Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with API_APPRUN classe
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00454101
Message ID:
00454470
Views:
32
>I think I will ask my question in an another way.
>
>I download the class API_APPRUN.
>I changed nothing to the class.
>I add SET CLASSLIB TO PROCESS ADDITIVE.
>I create a small form with a button.
>When I click it does:
>
>oProcess = CREATEOBJ('API_AppRun','NOTEPAD.EXE AUTOEXEC.BAT','C:\','NOR')
>oProcess.LaunchApp()
>
>(Code like in the sample in FAQ)
>
>When it run it fails and I receive an error
>
>Pgm:API_APPRUN.LAUNCHAPP/Line: 102
>Err.mess.:Data type mismatch.
>
>So one of the parameter is of the wrong type. I tried with the debugger to see which one but with any succes.
>
>Note : I am no expert with API Calls.
>
>Does this works with Win98? Probably yes. I use other classes from Web Connection and API calls works fine.
>
>May be I am forgetting something like an another class, a call?
>
>Any idea would be very appreciated, since I need exactly this functionality.
>

I don't know what exactly is the matter; the exact same code works fine on my system:

SET CLASSLIB TO PROCESS ADDITIVE
oProc = CREATEOBJ('API_APPRUN','NOTEPAD.EXE AUTOEXEC.BAT','C:\','NOR')
oProc.LaunchApp()

Line 102 of LaunchApp is the line that makes the call to CreateProcess(). At one point in time, I was using a call to DIRECTORY() to check if the starting directory existed, and some versions of Win9x had a problem with DIRECTORY() not identifying the root of the drive as a valid directory. Try the following and see if the problem goes away:
SET CLASSLIB TO PROCESS ADDITIVE
oProc = CREATEOBJ('API_APPRUN','NOTEPAD.EXE C:\AUTOEXEC.BAT','','NOR')
oProc.LaunchApp()


>Thank's
>Eric.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform