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 13 8156 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
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
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
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
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
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?
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.
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
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.
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
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Achim Domma |
last post by:
Hi,
I try to start a process on windows using win32process.CreateProcess and
want to to redirect the output. I set the STARTF_USESTDHANDLES flag in the
STARTUPINFO structure. But I can not...
|
by: david.humpherys |
last post by:
os:winnt
python2.3.2
I have a exe that dumps info to the command line. I want to run this
process and capture the stdout into a file. I think i'm close... any
help appreciated.
dh...
|
by: ByteSize |
last post by:
Would be grateful of advice please. I have code in VB6 working as follows:
lngReply = CreateProcess(sNull, txtStart, ByVal 0&, ByVal 0&, 1&, _
NORMAL_PRIORITY_CLASS, ByVal 0&, sNull, sInfo,...
|
by: DOT NET JIM |
last post by:
in VB6 the api declares the createprocess lbEnv var as any. When converted to
..NET is change the type any to Object. The problem is, what kind of object. I
can not get the env variables set when...
|
by: kal |
last post by:
Hi,
I am trying to write an application that will launch a second application
using CreateProcess...
SECURITY_ATTRIBUTES sa;
STARTUPINFO si;
PROCESS_INFORMATION pi;
::ZeroMemory( &sa,...
| |
by: Stefano Camaiani |
last post by:
Hello, please someone have the working code on how to call the CreateProcess
API in Vb.Net?
I need to call the CreateProcess API directly and i should not use the
Vb.Net Process functions like dim...
|
by: Paul Schenk |
last post by:
Hi All :)
Would be grateful of advice please. I have code in VB6
working as follows:
lngReply = CreateProcess(sNull, txtStart, ByVal 0&,
ByVal 0&, 1&, _
NORMAL_PRIORITY_CLASS, ByVal 0&,...
|
by: itmanager |
last post by:
I am trying to create a process at a particular set of coordinates (for
example 1,1) but the CreateProcess api seemingly ignores the settings in the
dwX and dwY properties of the STARTUPINFO...
|
by: Jai |
last post by:
Please provide sample code for using Createprocess in VB.NET. The code I am
using is given below. But I get "Error 91: Object referrence not set to an
instance of the object" at CreateProcess...
|
by: ss.teo |
last post by:
I want to fork a new process and my executable binary is stored inside
somewhere. Is there any possible way to fork a process using CreateProcess
API without writing to the disk first? Like let's...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |