|
In fact Ive called ShellExecute() to execute another application when clicking on the button on the dialog. And I want to suspend the current dialog until the app executed by ShellExecute() finishes its tasks. But I dont know how to do it. Can anyone help? Thanx in advance.
PS: I dont know whether WaitForSingleObject() will work.
|
|
|
|
|
If you WaitForSingleObject on the handle of the spawned process the thread doing the waiting will stop until the spawned app completes.
To get the process handle it might be an idea to use ShellExecuteEx as you can find out the handle of the spawned process a bit easier.
Cheers,
Ash
|
|
|
|
|
|
int RunAppAndWait(char *cmd)
{
PROCESS_INFORMATION ProcInfo;
STARTUPINFO StartInfo;
int exit_status = 0;
memset(&StartInfo, 0, sizeof(StartInfo));
StartInfo.cb = sizeof(StartInfo);
if (CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &StartInfo, &ProcInfo))
{
WaitForSingleObject(ProcInfo.hProcess, INFINITE);
GetExitCodeProcess(ProcInfo.hProcess, (unsigned long *)&exit_status);
CloseHandle(ProcInfo.hProcess);
CloseHandle(ProcInfo.hThread);
return exit_status;
}
return 1;
}
|
|
|
|
|
|
Hi, I have some data in char *szBuffer. I need to read the data fom the buffer nad put them into respected variable.
Suppose szBuffer returns "15,30\r\n CMD OK \r\n" , then I need to keep 15 in one variable,30 in other and CMD OK in other variable.
Can anyone help me how to do this. Any sample code will be good help for me.
Thanks..
|
|
|
|
|
Read up on tokenizing. See strtok() and strchr() for starters.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
The standard library is your friend if you're using C++. Have a look at:
- istringstream
- getline
and see what you can cobble together.
Cheers,
Ash
|
|
|
|
|
Can u please provide some sample code, I m very new in c++.
Thanks
|
|
|
|
|
We don't do homework around here. You have been given enough hints of what to use and read up on. Try to get something wotking. If you then have problems, post your code and explain what does not work. Someone will try to help you out.
Dave.
|
|
|
|
|
Hi
I want to get the column names in CListCtrl. Can any one show me the code for it.
|
|
|
|
|
Did you try the GetColumn() method?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I have made my own XML format which looks a bit like HTML, but I need a browser to read it. The built in browser windows in Visual studio can't read it, so I need to make a simple XML reader that displays the XML like HTML. Is there any very simple open source project I could edit, or is there a simple way to make an XML reader from scratch? Help would be appreciated
|
|
|
|
|
You can use the Microsoft MSXML[^] tools, or try a Google search for open source alternatives.
It's time for a new signature.
|
|
|
|
|
|
if it follows XML standards, then most (all?) broswer will be able to read it; it might not be able to understand the tags and their meanings (how to display them), see : http://msdn.microsoft.com/en-us/library/ms754529(VS.85).aspx[^]
You will need to create some sort of stylesheet to help display your XML files.
Watched code never compiles.
|
|
|
|
|
I will give you a simple example of what I'm trying to do:
Text in here will be displayed as normal, but <my own="" tag="">text in here will have a new formatting
Is there a way to make a "browser" that reads this kind of markup instead of HTML?
|
|
|
|
|
I have two option button or radio button BS_AUTORADIOBUTTON on a dialog. I have one label which I show just after first radio button. Some of label's portion is overlapping with radio button. So whenever I click on radio button, radio button comes above to that label. But I want label should always remain at top. How can I achieve this?
Thanks,
Rahul kulshreshtha
|
|
|
|
|
The z order of controls on a dialg is controlled by their order in the dialog box.
How to set this changes depending on which version of Visual Studio you are using.
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
Don't hack...Fix the overlapping in the resource editor.
Watched code never compiles.
|
|
|
|
|
Does the label belong to the radio button or is it an unrelated control?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
While running a program I got the following error Message:
Program:e:\Work\Cricket\Debug\SlogOut3D.exe
File:f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
Line:52
Expression:_BLOCK_TYPE_IS_VALID(pBlock->nBlockUse)
How to get out this error?
|
|
|
|
|
If you ever needed an advert to avoid pointers and dynamic memory allocation until you know what you're doing, this is it! The error happens when you're trying to delete an object or free a block of memory with a pointer that's invalid.
You're either:
- trying to delete or free something twice
- overwriting the pointer with an invalid value
The way of getting around this sort of error is not to do it. Use smart pointers rather than raw pointers to hold objects and use stack based variables wherever you can.
Cheers,
Ash
|
|
|
|
|
Could you explain me how to delete a pointer using a Smart Pointer?
|
|
|
|
|
That's the whole point: you don't. A smart pointer manages that task on its own and you don't have to care about it.
|
|
|
|