By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,114 Members | 1,574 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,114 IT Pros & Developers. It's quick & easy.

CreateProcess

P: n/a
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
es****@cerner.com in addition to posting it in this newsgroup if
possible.

Thanks
Elly Sokol
es****@cerner.com
Jul 22 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
es****@jetbiz.com (Elly Sokol) writes:
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
es****@cerner.com in addition to posting it in this newsgroup if
possible.

Thanks
Elly Sokol
es****@cerner.com


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.

--
Regards,
Misha Polatov
MetaCommunications Engineering
Jul 22 '05 #2

P: n/a
On Thu, 17 Jun 2004 16:51:57 -0500 in comp.lang.c++, Misha Polatov <mp******@meta-comm.com> wrote,
from MSDN/Platform SDK: DLLs, Processes, and Threads:


This comment is OFF TOPIC in comp.lang.c++. Please keep your answers to
standard portable C++ content and avoid proprietary API discussions.

See the welcome message posted twice per week in comp.lang.c++ or
available at http://www.slack.net/~shiva/welcome.txt

Jul 22 '05 #3

P: n/a
David Harmon wrote:
<snip>
See the welcome message posted twice per week in comp.lang.c++ or
available at http://www.slack.net/~shiva/welcome.txt


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

- Pete
Jul 22 '05 #4

P: n/a
Pete C. wrote:
When /is/ it posted? I've never actually seen it except for going to the
site...


It posts weekly.

http://groups.google.com/groups?selm...0uni-berlin.de

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.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 22 '05 #5

P: n/a
Elly Sokol wrote:
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
Jul 22 '05 #6

P: n/a
On Thu, 17 Jun 2004 22:10:45 GMT in comp.lang.c++, "Pete C." <x@x.x> wrote,
David Harmon wrote:
<snip>
See the welcome message posted twice per week in comp.lang.c++ or
available at http://www.slack.net/~shiva/welcome.txt


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


Today's post, June 17,
http://groups.google.com/gr*********...@uni-berlin.de

Twice a week slips in below BI=20

Jul 22 '05 #7

P: n/a
Phlip wrote:
Pete C. wrote:
When /is/ it posted? I've never actually seen it except for going to
the site...


It posts weekly.

http://groups.google.com/groups?selm...0uni-berlin.de

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
Jul 22 '05 #8

P: n/a
On Thu, 17 Jun 2004 23:16:15 GMT in comp.lang.c++, "Pete C." <x@x.x>
wrote,
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?

Jul 22 '05 #9

P: n/a
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.
Jul 22 '05 #10

P: n/a
David Harmon wrote:
On Thu, 17 Jun 2004 23:16:15 GMT in comp.lang.c++, "Pete C." <x@x.x>
wrote,
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?


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
Jul 22 '05 #11

P: n/a
Victor Bazarov <v.********@comAcast.net> wrote in message news:<8k******************@dfw-read.news.verio.net>...
Elly Sokol wrote:
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


Sorry. I did not realize NG this was just for Standard C++. I
thought it would answer any C++ question.
Jul 22 '05 #12

P: n/a
Misha Polatov <mp******@meta-comm.com> wrote in message news:<ur***********@meta-comm.com>...
es****@jetbiz.com (Elly Sokol) writes:
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
es****@cerner.com in addition to posting it in this newsgroup if
possible.

Thanks
Elly Sokol
es****@cerner.com


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
Jul 22 '05 #13

P: n/a
On Fri, 18 Jun 2004 12:44:50 GMT, "Pete C." <x@x.x> wrote:
David Harmon wrote:
On Thu, 17 Jun 2004 23:16:15 GMT in comp.lang.c++, "Pete C." <x@x.x>
wrote,
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?


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.
Jul 22 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.