Detect PPC before CeRapiInit hangs
Posted on 2003-03-29
I want to detect whether the desktop computer has a Pocket-PC connected. I've used CeRapiInit(), but it hangs indefinitely if a PPC isn't attached.
The eVC 3.0 documentation indicates:
"A call to CeRapiInit does not return until the connection is made, an error occurs, or another thread calls CeRapiUninit. The CeRapiInitEx function does not block the calling thread. Instead, it uses an event to signal when initialization is complete."
Is there a way to determine if a PPC is connected before invoking the CeRapiInit() statement? Am I using the CeRapiInit() call correctly?
I speculate from the documentation that perhaps another thread should be started that calls CeRapiUninit after a certain time period. Or perhaps I should use CeRapiInitEx with a timeout handler?
I'd appreciate a small program that shows code how to accomplish this.