Click here to Skip to main content
15,905,915 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: error C3861: '_beginthreadex': identifier not found [modified] Pin
Michael Schubert20-Aug-08 23:09
Michael Schubert20-Aug-08 23:09 
AnswerRe: error C3861: '_beginthreadex': identifier not found Pin
anaspsayed21-Nov-11 17:17
anaspsayed21-Nov-11 17:17 
QuestionIs there an API to return parent directory Pin
Parthi_Appu20-Aug-08 10:39
Parthi_Appu20-Aug-08 10:39 
AnswerRe: Is there an API to return parent directory Pin
Perspx20-Aug-08 11:24
Perspx20-Aug-08 11:24 
AnswerRe: Is there an API to return parent directory Pin
vikas amin20-Aug-08 11:28
vikas amin20-Aug-08 11:28 
GeneralRe: Is there an API to return parent directory Pin
Parthi_Appu20-Aug-08 11:48
Parthi_Appu20-Aug-08 11:48 
GeneralRe: Is there an API to return parent directory Pin
vikas amin4-Sep-08 12:58
vikas amin4-Sep-08 12:58 
QuestionCan I create a process in Windows service in MFC? Pin
laksh220420-Aug-08 3:30
laksh220420-Aug-08 3:30 
I am trying to do something like this:

> STARTUPINFO si;
> PROCESS_INFORMATION pi;
> BOOL bRes = false;
> DWORD dwCode = 0;
> ZeroMemory ( &si, sizeof ( STARTUPINFO));
> si.cb = sizeof ( STARTUPINFO);
> si.dwFlags = STARTF_USESHOWWINDOW;
> si.wShowWindow = SW_SHOWNORMAL;
>
> bRes = CreateProcess( NULL,
> (char *)it->second.c_str(), // some exe
> NULL,
> NULL,
> TRUE, // also tried FALSE
> NORMAL_PRIORITY_CLASS, //also tried 0
> NULL,
> NULL,
> &si,
> &pi
> );
> DWORD error = GetLastError();
> XERROR1( "ExecuteFailoverCommand :after execution Error=%d", error);
> if( bRes == false )
> {
> XERROR3( "ExecuteFailoverCommand :Error=%d, Could not invoke process %s
> for service %s", error, it->second.c_str(), ServiceName.c_str());
> }
> else
> {
> XTRACE2("ExecuteFailoverCommand : executed command %s on failure of %s
> returned %d", it->second.c_str(), ServiceName.c_str(),bRes);
> return true;
> }

This is working fine when I am calling CreateProcess from an exe but same is not working when it is being called from a running service. This may be due to reason that service puts the UI on a different desktop.

So, is there any other solution to this problem.

thanks in Adv
QuestionRe: Can I create a process in Windows service in MFC? Pin
led mike20-Aug-08 4:31
led mike20-Aug-08 4:31 
AnswerRe: Can I create a process in Windows service in MFC? Pin
Mark Salsbery20-Aug-08 5:51
Mark Salsbery20-Aug-08 5:51 
GeneralRe: Can I create a process in Windows service in MFC? Pin
led mike20-Aug-08 8:20
led mike20-Aug-08 8:20 
GeneralRe: Can I create a process in Windows service in MFC? Pin
Mark Salsbery20-Aug-08 8:23
Mark Salsbery20-Aug-08 8:23 
GeneralRe: Can I create a process in Windows service in MFC? Pin
laksh220420-Aug-08 21:17
laksh220420-Aug-08 21:17 
GeneralRe: Can I create a process in Windows service in MFC? Pin
Ahmed Charfeddine20-Aug-08 22:25
Ahmed Charfeddine20-Aug-08 22:25 
GeneralRe: Can I create a process in Windows service in MFC? Pin
Mark Salsbery21-Aug-08 5:55
Mark Salsbery21-Aug-08 5:55 
GeneralRe: Can I create a process in Windows service in MFC? Pin
laksh220425-Aug-08 2:00
laksh220425-Aug-08 2:00 
QuestionAccessing the USB HUman Interface Device properties from the devicemanager Pin
hariakuthota20-Aug-08 3:23
hariakuthota20-Aug-08 3:23 
QuestionAccessing the USB HUman Interface Device properties from the devicemanager Pin
hariakuthota20-Aug-08 3:23
hariakuthota20-Aug-08 3:23 
AnswerRe: Accessing the USB HUman Interface Device properties from the devicemanager Pin
Ștefan-Mihai MOGA20-Aug-08 8:46
professionalȘtefan-Mihai MOGA20-Aug-08 8:46 
QuestionFunction Calling Pin
polopo20-Aug-08 2:36
polopo20-Aug-08 2:36 
AnswerRe: Function Calling Pin
Nathan Going20-Aug-08 2:39
Nathan Going20-Aug-08 2:39 
AnswerRe: Function Calling Pin
David Crow20-Aug-08 3:06
David Crow20-Aug-08 3:06 
AnswerRe: Function Calling Pin
CPallini20-Aug-08 3:20
mveCPallini20-Aug-08 3:20 
AnswerRe: Function Calling Pin
SRKSHOME20-Aug-08 23:50
SRKSHOME20-Aug-08 23:50 
AnswerRe: Function Calling Pin
laksh220425-Aug-08 20:15
laksh220425-Aug-08 20:15 

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.