Click here to Skip to main content
14,869,122 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProcessing 'X' buttons message Pin
Tara143-Jul-06 3:12
MemberTara143-Jul-06 3:12 
AnswerRe: Processing 'X' buttons message Pin
Don Box3-Jul-06 3:33
MemberDon Box3-Jul-06 3:33 
GeneralRe: Processing 'X' buttons message Pin
Tara143-Jul-06 3:35
MemberTara143-Jul-06 3:35 
AnswerRe: Processing 'X' buttons message Pin
Hamid_RT3-Jul-06 3:39
MemberHamid_RT3-Jul-06 3:39 
GeneralRe: Processing 'X' buttons message Pin
Tara143-Jul-06 3:43
MemberTara143-Jul-06 3:43 
GeneralRe: Processing 'X' buttons message Pin
Hamid_RT3-Jul-06 3:53
MemberHamid_RT3-Jul-06 3:53 
GeneralRe: Processing 'X' buttons message Pin
Tara143-Jul-06 5:01
MemberTara143-Jul-06 5:01 
QuestionProblem with CreateProcess Pin
rajeevktripathi3-Jul-06 2:13
Memberrajeevktripathi3-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
mveGarth J Lancaster3-Jul-06 2:23 
AnswerRe: Problem with CreateProcess Pin
Viorel.3-Jul-06 2:30
MemberViorel.3-Jul-06 2:30 
AnswerRe: Problem with CreateProcess Pin
Viorel.3-Jul-06 2:47
MemberViorel.3-Jul-06 2:47 
AnswerRe: Problem with CreateProcess Pin
valikac3-Jul-06 6:44
Membervalikac3-Jul-06 6:44 
Questionabout timer Pin
happy_ram3-Jul-06 1:53
Memberhappy_ram3-Jul-06 1:53 
AnswerRe: about timer Pin
Maximilien3-Jul-06 1:57
MemberMaximilien3-Jul-06 1:57 
GeneralRe: about timer Pin
happy_ram3-Jul-06 2:00
Memberhappy_ram3-Jul-06 2:00 
AnswerRe: about timer Pin
see me3-Jul-06 2:02
Membersee me3-Jul-06 2:02 
GeneralRe: about timer Pin
happy_ram3-Jul-06 2:18
Memberhappy_ram3-Jul-06 2:18 
AnswerRe: about timer Pin
Viorel.3-Jul-06 2:03
MemberViorel.3-Jul-06 2:03 
GeneralRe: about timer Pin
happy_ram3-Jul-06 2:17
Memberhappy_ram3-Jul-06 2:17 
AnswerRe: about timer Pin
Hamid_RT3-Jul-06 3:14
MemberHamid_RT3-Jul-06 3:14 
Questionhow can i debug my project ! Pin
jalsa G3-Jul-06 1:52
Memberjalsa G3-Jul-06 1:52 
AnswerRe: how can i debug my project ! Pin
Maximilien3-Jul-06 1:55
MemberMaximilien3-Jul-06 1:55 
GeneralRe: how can i debug my project ! Pin
jalsa G3-Jul-06 2:07
Memberjalsa G3-Jul-06 2:07 
GeneralRe: how can i debug my project ! Pin
jalsa G3-Jul-06 2:21
Memberjalsa G3-Jul-06 2:21 
QuestionPicture & Bitmap Pin
Diglu3-Jul-06 1:34
MemberDiglu3-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.