Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateProcess

Status
Not open for further replies.

SteveD73

Programmer
Jan 5, 2001
109
0
0
GB
Hi

When using the following command under Windows 2000 I keep getting an Access Violation. Any Ideas on how to fix it?

CreateProcess("c:\\agd620.exe", "", NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, NULL, NULL);

Thanks

Craig
 
The 9th and 10th parameter can not be NULL. Try this:

STARTUPINFO sui;
memset ( &sui, 0, sizeof ( STARTUPINFO ));
sui.cb = sizeof ( STARTUPINFO );

PROCESS_INFORMATION pi;

if ( CreateProcess("c:\\agd620.exe", "", NULL, NULL, FALSE,
CREATE_NEW_CONSOLE, NULL, NULL, &sui, &pi ))
{ // You should close these handles right away
// if you don't need them
CloseHandle ( pi.hThread );
CloseHandle ( pi.hProcess ); }

Marcel

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top