CreateProcess

E

Elly Sokol

Is there a way to set the environment (specifically the PATH) for a
created process?

My current application was created using the correct path and I want
to "pass" this path to the newly created process which will be an
independent process of my current one.

Any ideas would be helpful.

I'd appreciate it if you could also email the reply to
(e-mail address removed) in addition to posting it in this newsgroup if
possible.

Thanks
Elly Sokol
(e-mail address removed)
 
M

Misha Polatov

Is there a way to set the environment (specifically the PATH) for a
created process?

My current application was created using the correct path and I want
to "pass" this path to the newly created process which will be an
independent process of my current one.

Any ideas would be helpful.

I'd appreciate it if you could also email the reply to
(e-mail address removed) in addition to posting it in this newsgroup if
possible.

Thanks
Elly Sokol
(e-mail address removed)

from MSDN/Platform SDK: DLLs, Processes, and Threads:

BOOL
CreateProcess(
LPCTSTR lpApplicationName
, LPTSTR lpCommandLine
, LPSECURITY_ATTRIBUTES lpProcessAttributes
, LPSECURITY_ATTRIBUTES lpThreadAttributes
, BOOL bInheritHandles
, DWORD dwCreationFlags
, LPVOID lpEnvironment
, LPCTSTR lpCurrentDirectory
, LPSTARTUPINFO lpStartupInfo
, LPPROCESS_INFORMATION lpProcessInformation
);

where lpEnvironment:
Pointer to an environment block for the new process. If this parameter is NULL,
the new process uses the environment of the calling process.
An environment block consists of a null-terminated block of null-terminated
strings. Each string is in the form:

name=value

Because the equal sign is used as a separator,
it must not be used in the name of an environment variable.

An environment block can contain either Unicode or ANSI characters.
If the environment block pointed to by lpEnvironment contains Unicode
characters, be sure that dwCreationFlags includes CREATE_UNICODE_ENVIRONMENT.

Note that an ANSI environment block is terminated by two zero bytes:
one for the last string, one more to terminate the block.
A Unicode environment block is terminated by four zero bytes:
two for the last string, two more to terminate the block.
 
P

Phlip

Pete said:
When /is/ it posted? I've never actually seen it except for going to the
site...

It posts weekly.

http://groups.google.com/[email protected]

Internet Infrastruction Irony #85,346: USENET has less of a spam problem
than private e-mail. That's because the servers can collude to reject any
post they see too often. But this means newsgroups can't post their welcome
messages more than once a week.
 
V

Victor Bazarov

Elly said:
Is there a way to set the environment (specifically the PATH) for a
created process?

There probably is, but Standard C++ (the subject of thin NG) does not
even have "CreateProcess". Please refer to your compiler/os manual or
a newsgroup dedicated to it/them.

V
 
P

Pete C.

Phlip said:
It posts weekly.

http://groups.google.com/[email protected]

Internet Infrastruction Irony #85,346: USENET has less of a spam
problem than private e-mail. That's because the servers can collude
to reject any post they see too often. But this means newsgroups
can't post their welcome messages more than once a week.

Hmm, it's not on my server, news.west.earthlink.net. Strange that it would
reject the welcome message yet I see quite a bit of spam...

- Pete
 
D

David Harmon

Hmm, it's not on my server, news.west.earthlink.net. Strange that it would
reject the welcome message yet I see quite a bit of spam...

That's odd, since it's on news.west... when I look there.
Have you killfiled it?
 
F

Fraser Ross

I've never seen the welcome message with my server news.v21.co.uk but it is
a poor server. Borland changed the cppbuilder language newsgroup to
borland.public.cppbuilder.language.cpp quite a long time ago. The other
Borland newsgroup must have changed name as well. The server name,
forums.borland.com is also needed to access them.

Fraser.
 
P

Pete C.

David said:
That's odd, since it's on news.west... when I look there.
Have you killfiled it?

Nope, my killfile is empty, and no filters. I tried Agent since you were
using that, but still didn't see it. Strange.
Perhaps since the EL servers require a login some sort of account settings
were changed.

- Pete
 
E

Elly Sokol

Victor Bazarov said:
There probably is, but Standard C++ (the subject of thin NG) does not
even have "CreateProcess". Please refer to your compiler/os manual or
a newsgroup dedicated to it/them.

V

Sorry. I did not realize NG this was just for Standard C++. I
thought it would answer any C++ question.
 
E

Elly Sokol

Misha Polatov said:
from MSDN/Platform SDK: DLLs, Processes, and Threads:

BOOL
CreateProcess(
LPCTSTR lpApplicationName
, LPTSTR lpCommandLine
, LPSECURITY_ATTRIBUTES lpProcessAttributes
, LPSECURITY_ATTRIBUTES lpThreadAttributes
, BOOL bInheritHandles
, DWORD dwCreationFlags
, LPVOID lpEnvironment
, LPCTSTR lpCurrentDirectory
, LPSTARTUPINFO lpStartupInfo
, LPPROCESS_INFORMATION lpProcessInformation
);

where lpEnvironment:
Pointer to an environment block for the new process. If this parameter is NULL,
the new process uses the environment of the calling process.
An environment block consists of a null-terminated block of null-terminated
strings. Each string is in the form:

name=value

Because the equal sign is used as a separator,
it must not be used in the name of an environment variable.

An environment block can contain either Unicode or ANSI characters.
If the environment block pointed to by lpEnvironment contains Unicode
characters, be sure that dwCreationFlags includes CREATE_UNICODE_ENVIRONMENT.

Note that an ANSI environment block is terminated by two zero bytes:
one for the last string, one more to terminate the block.
A Unicode environment block is terminated by four zero bytes:
two for the last string, two more to terminate the block.

Thanks for the info. It is very helpful.

Elly
 
F

Frederic Banaszak

Nope, my killfile is empty, and no filters. I tried Agent since you were
using that, but still didn't see it. Strange.
Perhaps since the EL servers require a login some sort of account settings
were changed.

- Pete

You've definitely got a problem somewhere. I see it posted on
news.west.earthlink.net twice a week. I just checked and it is on
news.east.earthlink.net also.

The latest two were posted 6/17/2004 and 6/13/2004.

As for why you can't see them I haven't a clue, but they are there,
and have been consistently, twice per week.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top