D
Dan Tanzer
I need a little help.
I am trying to get the space off of the storage card from the Pocket PC
using Rapi. Since i have not found a direct API (RAPI) to do this i wrote a
small .net compact framework exe to call GetDiskFreeSpaceEx create a file
with the data and then copy the file from the pocket pc to the PC. I am able
to run the CeCreateProcess with no problem and create the file but i cant
get the WaitForSingbject to wait for it to complete, it always fails wiht
the same message.
"Cannot create a file when that file already exists".
I thought it was the GetDiskFreeSpaceEx so i commented out all of the code
in my sample program "test.exe" and it fails with the same message.
Here is the code i am using .
[DllImport("rapi.dll", CharSet=CharSet.Unicode)]
public static extern int CeCreateProcess (string lpApplicationName, int
notused, int Res1, int Res2, int Res3, int dwCreationFlags, int Res4, int
Res5, int Res6,ref PROCESS_INFORMATION lpProcessInformation);
Rapi.PROCESS_INFORMATION pi = new Rapi.PROCESS_INFORMATION();
int x = Rapi.CeCreateProcess( @"\Program
files\zerama\test.exe",0,0,0,0,0,0,0,0, ref pi);
int ret = Rapi.WaitForSingleObject(pi.hProcess ,100000);
Rapi.CeCloseHandle(pi.hProcess);
Rapi.CeCloseHandle(pi.hThread);
Any Ideas?
Dan Tanzer
(e-mail address removed)
www.zerama.net
I am trying to get the space off of the storage card from the Pocket PC
using Rapi. Since i have not found a direct API (RAPI) to do this i wrote a
small .net compact framework exe to call GetDiskFreeSpaceEx create a file
with the data and then copy the file from the pocket pc to the PC. I am able
to run the CeCreateProcess with no problem and create the file but i cant
get the WaitForSingbject to wait for it to complete, it always fails wiht
the same message.
"Cannot create a file when that file already exists".
I thought it was the GetDiskFreeSpaceEx so i commented out all of the code
in my sample program "test.exe" and it fails with the same message.
Here is the code i am using .
[DllImport("rapi.dll", CharSet=CharSet.Unicode)]
public static extern int CeCreateProcess (string lpApplicationName, int
notused, int Res1, int Res2, int Res3, int dwCreationFlags, int Res4, int
Res5, int Res6,ref PROCESS_INFORMATION lpProcessInformation);
Rapi.PROCESS_INFORMATION pi = new Rapi.PROCESS_INFORMATION();
int x = Rapi.CeCreateProcess( @"\Program
files\zerama\test.exe",0,0,0,0,0,0,0,0, ref pi);
int ret = Rapi.WaitForSingleObject(pi.hProcess ,100000);
Rapi.CeCloseHandle(pi.hProcess);
Rapi.CeCloseHandle(pi.hThread);
Any Ideas?
Dan Tanzer
(e-mail address removed)
www.zerama.net