Click here to Skip to main content
15,890,609 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to compile .exe without trash ? Pin
Blake Miller3-Dec-04 4:00
Blake Miller3-Dec-04 4:00 
GeneralRe: How to compile .exe without trash ? Pin
mirex3-Dec-04 22:42
mirex3-Dec-04 22:42 
Generalcrecordset moveNext truncate Pin
Anonymous30-Nov-04 9:19
Anonymous30-Nov-04 9:19 
GeneralRe: crecordset moveNext truncate Pin
lisoft30-Nov-04 15:35
lisoft30-Nov-04 15:35 
Generalgenerate .lib file Pin
gecool30-Nov-04 6:44
gecool30-Nov-04 6:44 
GeneralRe: generate .lib file Pin
alex.barylski30-Nov-04 7:30
alex.barylski30-Nov-04 7:30 
GeneralRe: generate .lib file Pin
gecool1-Dec-04 23:14
gecool1-Dec-04 23:14 
GeneralCreateProcess in the service context Pin
pepe_ki30-Nov-04 6:34
pepe_ki30-Nov-04 6:34 
Hi guys,
I have been trying to resolve this for a couple of days already. I hope someone out there will be able to help me out here.
Introduction:
I created a "wrapper" executable, which "implements" interface required to be run as windows service. This executable has set of configuration files, which are used to prepare environment and define another binary to be run as a service.
So the wrapper - during its own start-up - creates a new process from those configuration files.
Problem:
The starting and stopping works fine, but when I start the service from some user context (Administrator) and then I log off, the child process is being killed and my service wrapper detects that and stops.
The service configuration uses LocalSystem as the user context.
The weird part is that if I do this through a RDP connection, the child process stays alive even after logoff.
Snippet:
memset(&si, 0, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
si.lpDesktop = "";
si.hStdOutput = hChildStdOut;
si.hStdInput = hChildStdIn;
si.hStdError = hChildStdErr;

BOOL ok = CreateProcess(NULL, lpszCmd, NULL, NULL, TRUE, // handles inherited
CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP , NULL, lpszPath, &si, piProcInfo);

Thanks in advance,
Peter
GeneralRe: CreateProcess in the service context Pin
Blake Miller30-Nov-04 6:46
Blake Miller30-Nov-04 6:46 
GeneralRe: CreateProcess in the service context Pin
pepe_ki30-Nov-04 7:03
pepe_ki30-Nov-04 7:03 
GeneralRe: CreateProcess in the service context Pin
Blake Miller1-Dec-04 5:36
Blake Miller1-Dec-04 5:36 
GeneralRe: CreateProcess in the service context Pin
pepe_ki1-Dec-04 11:12
pepe_ki1-Dec-04 11:12 
GeneralRe: CreateProcess in the service context Pin
pepe_ki1-Dec-04 13:09
pepe_ki1-Dec-04 13:09 
GeneralRe: CreateProcess in the service context Pin
Blake Miller2-Dec-04 3:50
Blake Miller2-Dec-04 3:50 
GeneralRe: CreateProcess in the service context Pin
pepe_ki1-Dec-04 13:30
pepe_ki1-Dec-04 13:30 
Generalautomation arguments array Pin
sougakoff30-Nov-04 6:27
sougakoff30-Nov-04 6:27 
GeneralHelp with regular/extension MFC dll Pin
Dudi Avramov30-Nov-04 6:15
Dudi Avramov30-Nov-04 6:15 
GeneralClipping regions Pin
Rassul Yunussov30-Nov-04 6:13
Rassul Yunussov30-Nov-04 6:13 
GeneralRe: Clipping regions Pin
PJ Arends30-Nov-04 11:32
professionalPJ Arends30-Nov-04 11:32 
GeneralDCOM Pin
Rassul Yunussov30-Nov-04 6:11
Rassul Yunussov30-Nov-04 6:11 
GeneralRe: DCOM Pin
David Crow30-Nov-04 8:08
David Crow30-Nov-04 8:08 
GeneralRe: DCOM Pin
Rassul Yunussov30-Nov-04 18:40
Rassul Yunussov30-Nov-04 18:40 
GeneralWIndows Sucks...GetOpenFileName COInitializeEx(COINIT_MULTITHREADED) Pin
suiram4030-Nov-04 5:54
suiram4030-Nov-04 5:54 
GeneralI found the work Pin
suiram4030-Nov-04 7:24
suiram4030-Nov-04 7:24 
GeneralDisabling ListCtrl Item Pin
brianwelsch30-Nov-04 4:19
brianwelsch30-Nov-04 4:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.