RAPI 'Connect' Event

G

Glyn Meek

We have a set of routines that we are using to synchronize file data between
the Pocket PC and the PC and we have used the excellent routines from the
OPENNETCF libraries to handle the RAPI stuff. Once we are connected, the
files transfer perfectly etc, but the only problem we have is that we cannot
seem to recognize the Connect event after a preceding Disconnect (Actually,
we can't recognize the Connect event at all, regardless of when we think we
should).

The Disconnect event fires fine when you disconnect the Pocket PC in any of
a myriad of ways, but subsequently (for example) putting it back into the
cradle after removing it (which generates the Disconnect event), doesn't
seem to fire a Connect event, even after ActiveSync has fired up again.

The interface and event declarations all appear to be fairly straightforward
(e.g. here is how we declare the event handler...

Dim WithEvents myRAPI As New RAPI
......
AddHandler myRAPI.RAPIConnected, AddressOf Connect

but we can never get into the event handler routine.

Can anyone tell us what physical happening triggers the Connect event, and
is there anything we are missing here?

Regards and thanks
 
A

Alex Feinman (MVP)

We have a set of routines that we are using to synchronize file data between
the Pocket PC and the PC and we have used the excellent routines from the
OPENNETCF libraries to handle the RAPI stuff. Once we are connected, the
files transfer perfectly etc, but the only problem we have is that we cannot
seem to recognize the Connect event after a preceding Disconnect (Actually,
we can't recognize the Connect event at all, regardless of when we think we
should).

The Disconnect event fires fine when you disconnect the Pocket PC in any of
a myriad of ways, but subsequently (for example) putting it back into the
cradle after removing it (which generates the Disconnect event), doesn't
seem to fire a Connect event, even after ActiveSync has fired up again.

The interface and event declarations all appear to be fairly straightforward
(e.g. here is how we declare the event handler...

Dim WithEvents myRAPI As New RAPI
.....
AddHandler myRAPI.RAPIConnected, AddressOf Connect

but we can never get into the event handler routine.

Can anyone tell us what physical happening triggers the Connect event, and
is there anything we are missing here?

Regards and thanks

Get the source code for the OpenNETCF.Communication and change the function
m_activesync_listen to look like this:

private void m_activesync_Active()
{
m_devicepresent = true;
if (RAPIConnected != null)
RAPIConnected();
}
 
D

Daniel Moth

....also if you are using AddHandler you don't need WithEvents on the
variable declaration.. If you remove AddHandler instead, you must have the
Handles keyword on your event handling method (you haven't showed us that).

Cheers
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top