|
If I follow you correctly, you're creating a process and want to get it's exit code, right?
HANDLE hProcess = CreateProcess(...);
WaitForSingleObject(hProcess, INFINITE); // Make sure it's done
DWORD dwExitCode;
GetExitCodeProcess(hProcess, &dwExitCode);
If the process is still active, dwExitCode == STILL_ACTIVE.
Hope this helps.
|
|
|
|
|
sultan_of_6string wrote:
WaitForSingleObject(hProcess, INFINITE); // Make sure it's done
sultan_of_6string wrote:
If the process is still active, dwExitCode == STILL_ACTIVE.
It wont be active as you are waiting INFINITEly
Nish
Has anyone seen my sig?
|
|
|
|
|
I know. Just telling you.
|
|
|
|
|
sultan_of_6string wrote:
I know. Just telling you.
Ok, thanks!
Nish
Has anyone seen my sig?
|
|
|
|
|
Thanks.
Just what I needed.
|
|
|
|
|
How do I add a DLL to a project. I created the DLL so that is not a problem. I have exported the appropriate functions but I don't know how to add it to the project and load it etc. Thanks if you can help.
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
project-->properties---->Linker--->additional dependenceis
Here add your .lib
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Thanks, I found examples of how to export functions but not how to import it into a project. Thanks Again
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
It's seem that the App's m_pszAppName and m_pszExeName member only contain the module name,is there a way to get the App's full path?
Scratch
|
|
|
|
|
GetModuleFileName is one way to get it. GetFullPathName is another.
|
|
|
|
|
A Q&D way that has never failed (for me, at least) is to use value of "CWinApp::m_pszHelpFilePath", and just replace the extension with your app's extension (usually "EXE").
Peace!
-=- James.
|
|
|
|
|
when I delete a certain object I get an assertation
_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
what is this and how do I fix it? Am I forgetting to do something in the destructor?
Steve
Not all who wander are lost...
|
|
|
|
|
You have been writing to memory you haven't allocated.
|
|
|
|
|
Steve Severance wrote:
when I delete a certain object I get an assertation
_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
Several things may cause this:
o You are trying to delete an invalid pointer (or a valid pointer to a stack-allocated object)
o You are trying to delete something that has already been freed
o You are trying to delete a pointer that was not allocated off of the same heap you are trying to deallocate it on
o Something stepped over the beginning or end of the allocated memory, and trashed the heap's management information
o Your heap may be corrupted
Etc... Good luck! Hopefully, it is something simple like a double-delete.
Peace!
-=- James.
|
|
|
|
|
Ok this is quite a simple question, but..
In a modal dialog box message loop, how can
I make some code be executed as soon as
WM_INITDIALOG etc. has been processed and
the dialog is visible on screen?
Eg. I want something in the message loop like.......
case (dialog is now visible on screen):
{
blah;
blah;
}
I do not want to use any MFC.
Any thoughts/solutions welcome
|
|
|
|
|
You can do it in OnShowWindow(BOOL bShow) for example.
bShow will be true when the window is being activated or shown
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need ASP hosting? Check out 123HostNow.com
|
|
|
|
|
Isn't OnShowWindow MFC?
I am writing a non-MFC app..
I have tried
case WM_SHOWWINDOW:
{
blah;
}
But the message is sent just before the dialog box is drawn... I need a message or something that is sent
just after the dialog has been drawn....
|
|
|
|
|
This is a common problem. Set a flag (bInitDlgDone ) when your WM_INITDIALOG completes. In your WM_SHOWWINDOW handler, execute "blah" only if
bInitDlgDone is TRUE.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ok I tried the flag thing, but the code "blah" is still
executed before the dialog is actually visible on screen.
Am I doing something wrong?
myflag is initially set to FALSE...
// inside message loop for dialog
case WM_INITDIALOG:
{
myflag=TRUE;
return TRUE;
}
break;
case WM_SHOWWINDOW:
{
if (myflag==TRUE)
{
blah;
}
}
break;
|
|
|
|
|
SeNs wrote:
"blah" is still executed before the dialog is actually visible on screen.
Hmmm. How about if you post a command from within your WM_INITDIALOG handler and execute "blah" in the command handler? What I mean is:
case WM_INITDIALOG:
...
PostMessage (WM_COMMAND, ID_DO_BLAH);
return (TRUE);
case WM_COMMAND:
switch (wParam) {
case ID_DO_BLAH:
blah;
break;
...
}
return (TRUE);
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I waana check if my string end with exact word,then if its true remove it from the end of string.What is the idea?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
The idea as I see it, like this:
CString csTheString, csLookupWord;
if(csTheString.Find(csLookupWord, csTheString.GetLength()-csLookupWord.GetLength) >= 0){
csTheString = csTheString.Left(csTheString.GetLength - csLookupWord.GetLength());
}
Maybe some mistakes, but you will see in debugger
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need ASP hosting? Check out 123HostNow.com
|
|
|
|
|
I got it now ,thanks
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Perhaps not the best solution, but...
CString string = "This is a string";
CString word = "string";
if (0 == string.Right(word.GetLength()).Compare(word) )
string = string.Left(string.GetLength()-word.GetLength());
/moliate
|
|
|
|
|
Thanks moliate,I will check this one too.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|