🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: microsoft.public.vc.language
6 messages
6 total messages Started by Herve Autret Wed, 04 Apr 2001 05:34
CreateProcess fails ...
#19
Author: Herve Autret
Date: Wed, 04 Apr 2001 05:34
39 lines
1987 bytes
Hi there...

I compile and run:
lpSi = (LPSTARTUPINFO) malloc (sizeof(STARTUPINFO)) ;
lpSi->cb = sizeof(STARTUPINFO) ;
lpPi=(LPPROCESS_INFORMATION)
        malloc(sizeof(PROCESS_INFORMATION));

assert ((CreateProcess(
        NULL,
        pArgStr,
        NULL,
        NULL,
        TRUE,
        0,
        NULL,
        NULL,
        lpSi,
        lpPi)) == TRUE ) ;

but my program fails as assert is FALSE... 

pArgStr is a space-separated string which causes no problem when used in
system(pArgStr), for instance...

I compile with bcc32
        -W for the .obj 
        nothing for the .exe

Have I done something wrong ?   

Hmm... for the X-post, let's say that I think that both groups are
concerned.

Regards
-- 
Herve Autret
-- 
Herve Autret
Re: CreateProcess fails ...
#20
Author: Jan Bares
Date: Wed, 04 Apr 2001 09:40
52 lines
2067 bytes
STARTUPINFO is *input* parameter....

Regards Jan

--

Jan Bares
(remove no.spam from my email address)
JPCAD Graphics Engine developer, surf to http://www.antek.cz


"Herve Autret" <autreh@free.fr> wrote in message
news:3ACAB336.2DA8E5DA@free.fr...
> Hi there...
>
> I compile and run:
> lpSi = (LPSTARTUPINFO) malloc (sizeof(STARTUPINFO)) ;
> lpSi->cb = sizeof(STARTUPINFO) ;
> lpPi=(LPPROCESS_INFORMATION)
>         malloc(sizeof(PROCESS_INFORMATION));
>
> assert ((CreateProcess(
>         NULL,
>         pArgStr,
>         NULL,
>         NULL,
>         TRUE,
>         0,
>         NULL,
>         NULL,
>         lpSi,
>         lpPi)) == TRUE ) ;
>
> but my program fails as assert is FALSE...
>
> pArgStr is a space-separated string which causes no problem when used in
> system(pArgStr), for instance...
>
> I compile with bcc32
>         -W for the .obj
>         nothing for the .exe
>
> Have I done something wrong ?
>
> Hmm... for the X-post, let's say that I think that both groups are
> concerned.
>
> Regards
> --
> Herve Autret
> --
> Herve Autret
Re: CreateProcess fails ...
#21
Author: Herve Autret
Date: Wed, 04 Apr 2001 21:54
15 lines
1587 bytes
Hi,

Jan Bares wrote:
 
> STARTUPINFO is *input* parameter....

Comprendo ! That's not what's written on my short papers. Do you know
the default parameters for a console application ?
Anyhow I'm going to have a look in a *true* Windows programming book ...
By the way, do you know a good one ?


best regards
-- 
Herve Autret
Re: CreateProcess fails ...
#22
Author: Jan Bares
Date: Thu, 05 Apr 2001 06:29
54 lines
2242 bytes
  // start the process
 STARTUPINFO StartInfo;

 StartInfo.cb  = sizeof(STARTUPINFO);
 StartInfo.lpReserved =
 StartInfo.lpDesktop =
 StartInfo.lpTitle = NULL;
 StartInfo.dwFlags = 0;
 StartInfo.cbReserved2 = 0;
 StartInfo.lpReserved2 = NULL;

 PROCESS_INFORMATION ProcessInfo;

 CreateProcess(NULL,
   "regsvr32.exe /s somedll.dll",
   NULL, NULL, // security
   FALSE,  // inherit handles
   0,  // default process flags
   NULL,  // use parent environment
   NULL, // current directory, ignored for 16-bit applications
   &StartInfo,
   &ProcessInfo);

// cleanup
 CloseHandle(ProcessInfo.hProcess);
 CloseHandle(ProcessInfo.hThread);



--

Jan Bares
(remove no.spam from my email address)
JPCAD Graphics Engine developer, surf to http://www.antek.cz


"Herve Autret" <autreh@free.fr> wrote in message
news:3ACB8AD5.6DAD0AAE@free.fr...
> Hi,
>
> Jan Bares wrote:
>
> > STARTUPINFO is *input* parameter....
>
> Comprendo ! That's not what's written on my short papers. Do you know
> the default parameters for a console application ?
> Anyhow I'm going to have a look in a *true* Windows programming book ...
> By the way, do you know a good one ?
>
>
> best regards
> --
> Herve Autret
>
Re: CreateProcess fails ...
#23
Author: Herve Autret
Date: Thu, 05 Apr 2001 19:23
17 lines
1525 bytes
hi,

Jan Bares wrote:

>  StartInfo.cb  = sizeof(STARTUPINFO);
>  StartInfo.lpReserved =
>  StartInfo.lpDesktop =
>  StartInfo.lpTitle = NULL;
>  StartInfo.dwFlags = 0;
>  StartInfo.cbReserved2 = 0;
>  StartInfo.lpReserved2 = NULL;

Very fine ! It runs now !!

Thanks a lot.
-- 
Herve Autret
Re: CreateProcess succeeds ...
#24
Author: Herve Autret
Date: Thu, 05 Apr 2001 19:30
17 lines
1528 bytes
hi,

Jan Bares wrote:

>  StartInfo.cb  = sizeof(STARTUPINFO);
>  StartInfo.lpReserved =
>  StartInfo.lpDesktop =
>  StartInfo.lpTitle = NULL;
>  StartInfo.dwFlags = 0;
>  StartInfo.cbReserved2 = 0;
>  StartInfo.lpReserved2 = NULL;

Very fine ! It runs now !!

Thanks a lot.
-- 
Herve Autret
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads