Click here to Skip to main content
15,921,660 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProcessing 'X' buttons message Pin
Tara143-Jul-06 3:12
Tara143-Jul-06 3:12 
AnswerRe: Processing 'X' buttons message Pin
Don Box3-Jul-06 3:33
Don Box3-Jul-06 3:33 
GeneralRe: Processing 'X' buttons message Pin
Tara143-Jul-06 3:35
Tara143-Jul-06 3:35 
AnswerRe: Processing 'X' buttons message Pin
Hamid_RT3-Jul-06 3:39
Hamid_RT3-Jul-06 3:39 
GeneralRe: Processing 'X' buttons message Pin
Tara143-Jul-06 3:43
Tara143-Jul-06 3:43 
GeneralRe: Processing 'X' buttons message Pin
Hamid_RT3-Jul-06 3:53
Hamid_RT3-Jul-06 3:53 
GeneralRe: Processing 'X' buttons message Pin
Tara143-Jul-06 5:01
Tara143-Jul-06 5:01 
QuestionProblem with CreateProcess Pin
rajeevktripathi3-Jul-06 2:13
rajeevktripathi3-Jul-06 2:13 
Hi All
I am having a problem in my application, what I am doing is:
Calling a function SaveKeys(TCHAR *) within a loop and this function save the specified registry key to a .reg file,
for this using CreateProcess( ) for calling regedit.exe from command line and WaitForSingleObject( ) function.
code looks like this
<br />
for (int i = 0; i < 10; i++)<br />
{<br />
    // some code here<br />
   SaveKeys(cRegistryKey );  // for specified Registry Key<br />
}<br />
<br />
void MyClass::SaveKeys(TCHAR *cRegistryKey)<br />
{<br />
        STARTUPINFO			StartupInfo;<br />
	PROCESS_INFORMATION ProcessInformation;<br />
  <br />
        CreateProcess(NULL, cCommand,NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE|CREATE_SUSPENDED,NULL, NULL, &StartupInfo, &ProcessInformation);<br />
WaitForSingleObject( ProcessInformation.hProcess, INFINITE );<br />
<br />
}<br />
//e.g. Here cCommand  = regedit /e C:\File.reg HKEY_CURRENT_USER\MyKey<br />

Now what is my problem is that here WaitForSingleObject( ) function is not working. and only a single reg file is created.
and when use Sleep(1000) then all the 10 reg file are created.

So please tell me that how should I overcome this problem.

Please reply
Thanks
AnswerRe: Problem with CreateProcess Pin
Garth J Lancaster3-Jul-06 2:23
professionalGarth J Lancaster3-Jul-06 2:23 
AnswerRe: Problem with CreateProcess Pin
Viorel.3-Jul-06 2:30
Viorel.3-Jul-06 2:30 
AnswerRe: Problem with CreateProcess Pin
Viorel.3-Jul-06 2:47
Viorel.3-Jul-06 2:47 
AnswerRe: Problem with CreateProcess Pin
valikac3-Jul-06 6:44
valikac3-Jul-06 6:44 
Questionabout timer Pin
happy_ram3-Jul-06 1:53
happy_ram3-Jul-06 1:53 
AnswerRe: about timer Pin
Maximilien3-Jul-06 1:57
Maximilien3-Jul-06 1:57 
GeneralRe: about timer Pin
happy_ram3-Jul-06 2:00
happy_ram3-Jul-06 2:00 
AnswerRe: about timer Pin
see me3-Jul-06 2:02
see me3-Jul-06 2:02 
GeneralRe: about timer Pin
happy_ram3-Jul-06 2:18
happy_ram3-Jul-06 2:18 
AnswerRe: about timer Pin
Viorel.3-Jul-06 2:03
Viorel.3-Jul-06 2:03 
GeneralRe: about timer Pin
happy_ram3-Jul-06 2:17
happy_ram3-Jul-06 2:17 
AnswerRe: about timer Pin
Hamid_RT3-Jul-06 3:14
Hamid_RT3-Jul-06 3:14 
Questionhow can i debug my project ! Pin
jalsa G3-Jul-06 1:52
jalsa G3-Jul-06 1:52 
AnswerRe: how can i debug my project ! Pin
Maximilien3-Jul-06 1:55
Maximilien3-Jul-06 1:55 
GeneralRe: how can i debug my project ! Pin
jalsa G3-Jul-06 2:07
jalsa G3-Jul-06 2:07 
GeneralRe: how can i debug my project ! Pin
jalsa G3-Jul-06 2:21
jalsa G3-Jul-06 2:21 
QuestionPicture & Bitmap Pin
Diglu3-Jul-06 1:34
Diglu3-Jul-06 1:34 

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.