Has anyone here worked with the RAPI functions to interact with your FWPPC app? I am trying to invoke a maintenance routine from the desktop using Rapi, but with little success. Specifically, I am trying to use the CeCreateProcess function to start this. I am able to successfully initialize/uninitialize the Rapi session, but when I call CeCreateProcess, I consistently get a Winerror #2 -- File Not Found.
I am using Xbase++ on the desktop. Here's a sample trying to invoke the calculator. I get error #2 regardless of the way I specify the app name (ie; "calc.exe", "\\My Device\Windows\calc.exe", "calc", etc)
- Code: Select all Expand view
#include "DLL.CH"
#define NULL 0
Procedure Main
Local xVal
xVal := CeRapiInit()
? xVal
If xVal <> 0
QUIT
Endif
xVal := CeCreateProcess( "\Windows\calc.exe", ;
"", ;
NULL, ;
NULL, ;
.f., ;
NULL, ;
NULL, ;
NULL, ;
NULL, ;
NULL )
? xVal
? CeRapiGetError()
? CeGetLastError()
xVal := CERapiUninit()
? xVal
RETURN
DLLFUNCTION CeRapiGetError() USING STDCALL FROM RAPI.DLL
DLLFUNCTION CeGetLastError() USING STDCALL FROM RAPI.DLL
DLLFUNCTION CeRapiInit() USING STDCALL FROM RAPI.DLL
DLLFUNCTION CeRapiUninit() USING STDCALL FROM RAPI.DLL
DLLFUNCTION CeRapiInvoke( cPath, ;
cFunction, ;
nInputBytes, ;
nInput, ;
nOutPutBytes, ;
nOutput, ;
nNull ) USING STDCALL FROM RAPI.DLL
DLLFUNCTION CeCreateProcess(cApp, ;
cParm, ;
nZip1, ;
nZip2, ;
lFalse, ;
nZero, ;
nZip3, ;
nZip4, ;
nZip5, ;
nZip6 ) USING STDCALL FROM RAPI.DLL
Thanks in advance for any ideas.