Click here to Skip to main content
15,889,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalpls help: Access Violation Pin
valerie993-Aug-05 9:14
valerie993-Aug-05 9:14 
GeneralRe: pls help: Access Violation Pin
David Crow3-Aug-05 10:18
David Crow3-Aug-05 10:18 
GeneralRe: pls help: Access Violation Pin
valerie993-Aug-05 10:40
valerie993-Aug-05 10:40 
GeneralRe: pls help: Access Violation Pin
Blake Miller3-Aug-05 10:28
Blake Miller3-Aug-05 10:28 
GeneralRe: pls help: Access Violation Pin
valerie993-Aug-05 10:53
valerie993-Aug-05 10:53 
GeneralRe: pls help: Access Violation Pin
valerie993-Aug-05 12:48
valerie993-Aug-05 12:48 
GeneralCalibration in ATM machines Pin
celllllllll3-Aug-05 7:52
celllllllll3-Aug-05 7:52 
GeneralRe: Calibration in ATM machines Pin
Maximilien3-Aug-05 8:15
Maximilien3-Aug-05 8:15 
GeneralRe: Calibration in ATM machines Pin
celllllllll3-Aug-05 8:23
celllllllll3-Aug-05 8:23 
GeneralRe: Calibration in ATM machines Pin
GKarRacer3-Aug-05 8:36
GKarRacer3-Aug-05 8:36 
GeneralRe: Calibration in ATM machines Pin
celllllllll3-Aug-05 12:16
celllllllll3-Aug-05 12:16 
GeneralRe: Calibration in ATM machines Pin
GKarRacer3-Aug-05 13:18
GKarRacer3-Aug-05 13:18 
GeneralRe: Calibration in ATM machines Pin
celllllllll3-Aug-05 14:00
celllllllll3-Aug-05 14:00 
GeneralRe: Calibration in ATM machines Pin
GKarRacer4-Aug-05 6:16
GKarRacer4-Aug-05 6:16 
GeneralRe: Calibration in ATM machines Pin
celllllllll4-Aug-05 8:32
celllllllll4-Aug-05 8:32 
GeneralRe: Calibration in ATM machines Pin
GKarRacer4-Aug-05 9:03
GKarRacer4-Aug-05 9:03 
If the Recalibrate function is contained within your own process, then waiting for the process to complete won't work. You'll be waiting for yourself to exit. However, if recalibrate spawns off another thread (sounds possible since it returns immediately) then you can wait on the thread handle instead.

Use these tests to verify that another thread was launched.

Add code similar to:

pTouch->Recalibrate();
HWND hWnd = FindWindow(...);
DWORD RecalProcID;
DWORD RecalThreadID = GetWindowThreadProcessId( hWnd, &ProcID );
DWORD MyProcID = GetCurrentProcessId();
DWORD MyThreadID = GetCurrentThreadId();
HANDLE hRecalThread = OpenThread( SYNCHRONIZE, FALSE, RecalThreadID );


Put a breakpoint before the recalibrate call.
When breakpoint is hit, open the threads window (menu: Debug/Windows/Threads)
Monitor this window to see if another thread is created when recalibrate is executed.

If in the same process, then RecalProcID will match MyProcID.
If different thread, then RecalThreadID will be different than MyThreadID.

What you're looking for is that RecalThreadID is created fresh when Recalibrate is called (or when TouchScreen object is created) and that the thread goes away when the calibration is done.

If, on the other hand, RecalThreadID is the same as MyThreadID then you cannot use MsgWaitForMultipleObjects to wait on anything as you will be waiting on yourself. Then about the only you can do is check IsWindow periodically inside a PeekMessage loop. Undoubtedly you will need to process messages as the recalibrate itself will be depending on it.

What does the Recalibrate function return? Are there any other functions for checking for status?

Ultimately if the recalibrate spawns another thread and then the thread goes away when recalibration is complete, then you don't even need the IsWindow loop - just the MsgWaitForMultipleObjects.


GeneralRe: Calibration in ATM machines Pin
celllllllll4-Aug-05 11:15
celllllllll4-Aug-05 11:15 
GeneralRe: Calibration in ATM machines Pin
GKarRacer4-Aug-05 11:42
GKarRacer4-Aug-05 11:42 
GeneralRe: Calibration in ATM machines Pin
celllllllll4-Aug-05 12:13
celllllllll4-Aug-05 12:13 
GeneralRe: Calibration in ATM machines Pin
celllllllll5-Aug-05 5:58
celllllllll5-Aug-05 5:58 
GeneralRe: Calibration in ATM machines Pin
GKarRacer5-Aug-05 10:11
GKarRacer5-Aug-05 10:11 
GeneralRe: Calibration in ATM machines Pin
celllllllll5-Aug-05 11:53
celllllllll5-Aug-05 11:53 
Generalproblem in CFtpConnection::OpenFile() Pin
Aditya Rao3-Aug-05 7:47
Aditya Rao3-Aug-05 7:47 
GeneralRe: problem in CFtpConnection::OpenFile() Pin
Anonymous3-Aug-05 12:13
Anonymous3-Aug-05 12:13 
Generalremoving spaces in string Pin
Anonymous3-Aug-05 7:39
Anonymous3-Aug-05 7:39 

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.