|
I think you should try GetExitCodeProcess function after WaitForSingleObject , but before you close the process's handle with CloseHandle .
I hope it helps.
|
|
|
|
|
use GetExitCodeProcess()
nave
|
|
|
|
|
"How can I get the return code of that process"
You can use GetExitCodeProcess Is this your purpose?
|
|
|
|
|
Hello
Does someone know if (and how) I can change the output language of my visual c++ compiler? I got a new computer from our sysadmin and he installed visual studio in german ... now are also the compiler outputs in german which makes it hard to search on google ... also I'm not used to this
Anyone knows something?
Thanks,
gri
So long and thanks for the fish!
|
|
|
|
|
You cannot change the language of Visual Studio. You must reinstall it using the english version of Visual Studio.
|
|
|
|
|
If you use VS2003 you can find the according setting in Tools - Options... - Environment - International Settings - Language.
Regards,
Tim
|
|
|
|
|
Thanks but I already found this ... there it can't be changed
Only values in the listbox are German and "Like Office (Neutral)" which leads also to German - and also I don't have Office :P
I thought about some registry value that cl.exe outputs english, not german ... the IDE language does not matter.
thanks,
gri
So long and thanks for the fish!
|
|
|
|
|
hello,
i'am creating threads to run some listeners,
i have an error which i have not understanded
the compiler says that _beginthread is undeclared but i have included process.h ??
this is the code
#include <windows.h>
#include <process.h> /* _beginthread, _endthread */
#include <stddef.h>
#include <stdlib.h>
void main()
{
HANDLE hThread;
unsigned threadID;
// Create the second thread.
hThread = (HANDLE)_beginthread( NULL, 0, &SecondThreadFunc, NULL, 0, &threadID );
// Wait until second thread terminates. If you comment out the line
// below, Counter will not be correct because the thread has not
// terminated, and Counter most likely has not been incremented to
// 1000000 yet.
WaitForSingleObject( hThread, INFINITE );
// Destroy the thread object.
CloseHandle( hThread );
return 0;
}
|
|
|
|
|
Better use CreateThread().
Come online at:-
fitiyal@yahoo.com
|
|
|
|
|
i used it
but when executing the function (with debugger) the parameter ( whose type is char*)
pass directly to a NULL parameter .
Note: the function is executing normally without thread !
|
|
|
|
|
Did you see example from this function in msdn?
From the MSDN
Example
The following example uses _beginthread and _endthread.
#include <windows.h>
#include <process.h>
#include <stddef.h>
#include <stdlib.h>
#include <conio.h>
...
...
</code>
|
|
|
|
|
this is exactly which i was talking about
the problem is in this sample
|
|
|
|
|
You get this error
"c:\C\1112\Main.cpp(29): error C3861: '_beginthread': identifier not found, even with argument-dependent lookup"
Did you see this line in this example
// compile with: /MT /D "_X86_" /c
|
|
|
|
|
i tryed to compile it wth this cmd line but the compiler
(i tryed with cl.exe) didn't accept this !
|
|
|
|
|
|
win32 application
|
|
|
|
|
Did you set /MT /D "_X86_" /c to runtime library
|
|
|
|
|
How can i compile with /MT option ???
|
|
|
|
|
Right click in your project in solution Explorer ->select property->(Configuration properties)Open C/C++ ->code generation ->now you can see Runtime Library then select Multi-threaded Debug DLL (/MDd)
|
|
|
|
|
Open the Project Settings dialog (Alt+F7). Click the C/C++ tab. Select the Code Generation category. In the run-time library combobox, select Multithreaded (/MT) or Debug Multithreaded (/MTd).
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
in a particular situation, my pointer pManager becomes somewhat faulty. It passes the if (pManager) { check, but most of the members are not active and the code crashes when I try to access them.
Now, I want to check if a particular member inside the pointer is valid. When I try like this if (pManager->bMember) { , the code crashes. Are there any functions to check the integrity of a member?
Regards,
Stefan
|
|
|
|
|
Stefan Spenz wrote: When I try like this if (pManager->bMember)
pManager itself is invalid that is why the error occurs.
You can use IsBadReadPtr,IsBadWritePtr according to your requirement.
But you could handle the situation without these functions.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Pattern
|
|
|
|
|
do you construct the object correctly, and how to you assign pManager ?
|
|
|
|
|
How do you declare pManager Can you show
|
|
|
|
|
If the pointer pManager was never initialized using
pManager = new Manager(); that will cause this problem.
If the pointer pManager was initialized but now causes an access violation, it probably means the you have issued a "delete pManager; " at some point. pManager now points to memory you no longer own.
Software Zen: delete this;
|
|
|
|