Can anyone help me with this issue?
Thanks.
Ketan Mehta
DigiCon Systems
281-531-1107
--
Terence "Dr. CE" Goggin
Information Appliance Assoc.
Windows CE Development and Consulting
terencegoggin AT hotmail DOT com
Ketan Mehta <dig...@pdq.net> wrote in message
news:11d201c053e8$8ce96d00$66862ecf@cpmsftngxa07...
CreateProcess should work for you provided you understand some of the
nuances of CE. For example, a process in CE does not have the concept of
"current directory" so you always have to give a full path.
In case you are leary about posting your code on a public newsgroup, here's
some code I wrote a while back that launches pvbload.exe.
Let us know if this helps or not.
Gary Peluso
Microsoft
Windows CE Developer Support
// testvc.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
BOOL bRet;
PROCESS_INFORMATION pi;
bRet = CreateProcess(TEXT("\\windows\\pvbload.exe"),
TEXT("\\My Documents\\Test\\Project1.vb"),
NULL, NULL, FALSE, 0, NULL, NULL, NULL, &pi);
if (!bRet)
{
TCHAR szDebug[80];
wsprintf(szDebug, TEXT("CreateProcess failed: %d"), GetLastError());
MessageBox(NULL, szDebug, NULL, MB_OK);
return 0;
}
// cleanup
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return 0;
}
I didn't get your sample code post the first time. Sorry about that.
In looking at your code you are not passing a buffer for the Process
Information.
This is a required parameter. That is why CreateProcess is failing in your
case.
Because there are no UDTs in VB you must implement a C/C++ DLL
that will do the call to CreateProcess. This is what we've prescribed in
the past.
The PROCESS_INFORMATION structure will contain a handle to the process and
a handle
to the main thread. These must be closed otherwise your application will
be leaking handles.
Let us know if you have any further questions.