This topic is now archived and is closed to further replies.

VC++ Question

This topic is 6111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


Depending on quite what you need when calling your external *.exe. (Whether you need a special command line arguments or enviroment) I'd use either one of the spawn functions.

For example to call the command "c:\bin\dosomething.exe 27 hello"
Using _spawnl

int _spawnl( int mode, const char *cmdname, const char *arg0, const char *arg1, ... const char *argn, NULL );

#include <process.h>

char* cmd = "c:\\bin\\dosomething.exe";
char* arg1 = "27";
char* arg2 = "hello";
int ret = _spawnl ( _P_WAIT, cmd, cmd, arg1, arg2, NULL );

Hope this helps


Edited by - TomH on March 19, 2001 8:20:04 AM

Edited by - TomH on March 19, 2001 8:32:06 AM

Share this post

Link to post
Share on other sites