Asynchronous Connection not working on Win7


If the device is connected after doing rapi.Connect(false, -1), RapiConnected event is never fired, even if ActiveSync seems to work fine (In VisualStudio's Output window the strings written by ActiveSync events seems Ok to me).
It seems that in RAPI.InitThreadProc() the line
ret = WaitForSingleObject(m_ri.heRapiInit, 250);
always returns WAIT_TIMEOUT and never WAIT_OBJECT_0 even if the device is connected.
In Windows Xp it works just fine.
If the device is connected BEFORE launching the application which does rapi.Connect(false, -1), WAIT_OBJECT_0 is correctly returned and RapiConnected is correctly raised.
Any ideas on how to fix this? Have the WinAPIs so significantly changed in Win7?
Closed Oct 5, 2012 at 7:42 AM by RobertWachtel
Since there is only one vote and no confirmation of this behaviour since over a year I close this item.


Ptrevino wrote Jun 2, 2011 at 8:15 PM

I'm also having the same problem when the user logs in and rapi.devicepresent is false while the device is sitting on the cradle. Any updates on fixing the code? Are there any work arounds to force the RapiConnected event to fire up?

wrote Oct 5, 2012 at 7:42 AM

wrote Feb 21, 2013 at 10:57 PM

wrote May 16, 2013 at 10:42 AM