|
In general, it is best if you can avoid using TerminateThread because that will really kill the thread (so you won't be able to do clean-up tasks or things like that). What you'll have probably is a kind of loop (while something is true, you continue processing). So, what you could do is set this variable to false in the other thread.
|
|
|
|
|
Thank you Cédric.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
I think these links will helpful for you link1[^] and link2[^]
|
|
|
|
|
WhiteSky wrote: I think these links will helpful for you link1[^] and link2[^]
Yes, it was useful, thanks.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
You're welcome
|
|
|
|
|
From MSDN:
You should call TerminateThread only if you know exactly what the target thread is doing, and you control all of the code that the target thread could possibly be running at the time of the termination. For example, TerminateThread can result in the following problems:
:If the target thread owns a critical section, the critical section will not be released.
:If the target thread is allocating memory from the heap, the heap lock will not be released.
:If the target thread is executing certain kernel32 calls when it is terminated, the kernel32 state for the thread's process could be inconsistent.
:If the target thread is manipulating the global state of a shared DLL, the state of the DLL could be destroyed, affecting other users of the DLL.
So you can either wait until all the threads finish execution or return from the thread function when some condition is violated.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks _AnShUmAn_, some useful info to know.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
It's a pleasure
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
SetWindowsHookEx(WH_MOUSE, KeyBoardProc, g_hMod, 0);<br />
<br />
LRESULT CALLBACK KeyBoardProc(INT iCode, WPARAM wParam, LPARAM lParam)<br />
{<br />
<br />
}
How to know the "A" key is down and the CTRL key is down?
how to get {repeat count, scan code, extended-key flag, context code, previous key-state flag, transition-state flag} from lParam?
and what is KF_DLGMODE? how to use it in KeyBoardProc?
Thanks very much.
|
|
|
|
|
|
HOW WHAT wrote: How to know the "A" key is down and the CTRL key is down?
Look at MSDN for GetKeyState() , GetAsyncKeyState()
|
|
|
|
|
The dos window is displayed when running the batch file ,that batch file have a call to exe.how to hide this dos window (cmd.exe)
|
|
|
|
|
Are you using "start " command for launching your application ?
Regards,
Paresh.
|
|
|
|
|
I am not using start command
This is my batch file content :
@echo off
rem Add a new TAP-Win32 virtual ethernet adapter
"C:\Program Files\OpenVPN\bin\tapinstall.exe" install "C:\Program Files\OpenVPN\driver\OemWin2k.inf" tap0801
exit
-- modified at 4:00 Friday 20th April, 2007
|
|
|
|
|
Use of ShellExecute with SW_HIDE
|
|
|
|
|
Hi All,
How can i convert LPWSTR to CString. Can anyone please help.
Thanks,
Arun.
|
|
|
|
|
arunperi wrote: convert LPWSTR to CString
LPWSTR pwStr;
CString s = pwStr;
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Actually I am not getting the whole text instead i'm getting only the first character.
---Arun.
|
|
|
|
|
(Voting you 5 because you answer was correct but you had two 1 votes for some reason.)
|
|
|
|
|
Look at one of the constructor of CString,
CString( LPCWSTR lpsz );<br />
throw( CMemoryException );
PS. Where are you seeing the only one char ?
Regards,
Paresh.
|
|
|
|
|
Paresh Chitte wrote: PS. Where are you seeing the only one char ?
you didn't get it.
his project certainly doesn't define UNICODE, so his CString is actually CStringA (ansi string - char*).
but he assigns a wide characters string into an ansi string; and wide string contain \0 bytes into some characters, that's why he sees only the first one...
BTW, see my other reply to have a working solution for this pb
|
|
|
|
|
The ANSI/Unicode setting doesn't affect the CString ctor that accepts an LPCWSTR .
|
|
|
|
|
then why does the OP get only the first character of his original string ?
|
|
|
|
|
LPWSTR pwStr;
CString s = <code>CW2T</code>(pwStr);
|
|
|
|
|
Or you can just use the CString ctor that accepts an LPCWSTR , as the other posters said.
|
|
|
|