>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.