Click here to Skip to main content
15,885,309 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
A couple of things:

1. Does the pTouch->Recalibrate and/or CTouchScreenAPI::Create spawn another process? Or is the recalibrate function contained within your own process (separate thread maybe?) Does recalibrate return immediately?

2. You don't necessarily need to do both the IsWindow loop and the process loop. In any case you need to call GetWindowThreadProcessId before the IsWindow loop. Otherwise, what's the point? The window is gone so the call will always fail.

3. Don't use PROCESS_ALL_ACCESS unless you absolutely have to. Use the minimum security setting to get the job done. Depending on the circumstances and user's security level the call may fail trying for all access. SYNCHRONIZE is all you need for waiting on the handle. If you need to call TerminateProcess then add PROCESS_TERMINATE as well.

4. You might want to use QS_ALLINPUT rather than QS_PAINT so that all messages get processed. See "Waiting in a message_loop"" for an example.

5. Since you're apparently doing all this in a window oriented thread (probably you're main thread), you don't want to use Sleep(1000). This will just freeze up your window while you're waiting in the loop. It'd better doing only the process wait loop, peek message loop, or using a window hook to wait for close notification of the window.

6. It's kind of pointless to call TerminateProcess immediately after SendMessage. You're not exactly giving the process much time to clean up and exit normally. Don't call TerminateProcess except as last resort.
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 
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 
GeneralRe: removing spaces in string Pin
David Crow3-Aug-05 7:52
David Crow3-Aug-05 7:52 
GeneralRe: removing spaces in string Pin
Anonymous3-Aug-05 12:15
Anonymous3-Aug-05 12:15 
GeneralRe: removing spaces in string Pin
Jose Lamas Rios3-Aug-05 19:06
Jose Lamas Rios3-Aug-05 19:06 
GeneralRe: removing spaces in string Pin
David Crow7-Aug-05 8:15
David Crow7-Aug-05 8:15 
General,remove spaces in a string Pin
Anonymous3-Aug-05 7:38
Anonymous3-Aug-05 7:38 
GeneralRe: ,remove spaces in a string Pin
Chris Meech3-Aug-05 8:16
Chris Meech3-Aug-05 8:16 

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.