Hello all.
I've been working on this problem for a few days now, and I am running
out of ideas. I have been unable to find any information on the
internet related this issue, and I am hoping that someone here may be
able to give me some advice.

I'm making a VC++ tray application that pushes a variety of files to
the PocketPC. Currently I use RAPI for the binary files and
shortcuts, and the DesktopToDevice function imported from adofiltr.dll
for some databases. The application currently uses an HP PocketPC
with ActiveSync 3.5.

The problem is when the device powers off in the middle of transfering
a database using DesktopToDevice. After restoring the device power
any RAPI calls my program makes return the error "Returned by WSARecv
or WSARecvFrom to indicate the remote party has initiated a graceful
shutdown sequence."

This error remains no matter how many times I recradle or power the
device on and off. The only way to get rid of the error is to reset
the device (which doesn't always work), or to restart my application
(out of the question).

My transfer function calls CeRapiUninit() before exiting, regardless
of any errors encountered, so I know that the connection /should/ be
closed. But after closing the connection any call I make returns the
same error code. To me it looks like RAPI isn't cleaning up after
itself. I even tried unloading and reloading the DLLs that I use in
the hopes that the connection to the device would be reset, but to no
avail.

So my question is this: Is there any way to reinitialize RAPI without
shutting down the application or resetting the device?


Thanks in advance,
Mars

Re: Rapi connection not re-initializing after device power off by Amit

Amit
Sat Aug 02 00:28:30 CDT 2003

Hi,
Well am not sure how to do that,but surely would try to find some way.But
meanwhile you can sure stop device from automaticaly powering off.Write an
exe which would run on device and will call SystemIdleTimerReset ().and you
can invoke the exe from desktop using CeCreateProcess()

Regards
Amit
"Mars" <usenet@redplanet.ca> wrote in message
news:jk2liv8qh1l3srj7cjm0p8j7l8i4kgfr68@4ax.com...
> Hello all.
> I've been working on this problem for a few days now, and I am running
> out of ideas. I have been unable to find any information on the
> internet related this issue, and I am hoping that someone here may be
> able to give me some advice.
>
> I'm making a VC++ tray application that pushes a variety of files to
> the PocketPC. Currently I use RAPI for the binary files and
> shortcuts, and the DesktopToDevice function imported from adofiltr.dll
> for some databases. The application currently uses an HP PocketPC
> with ActiveSync 3.5.
>
> The problem is when the device powers off in the middle of transfering
> a database using DesktopToDevice. After restoring the device power
> any RAPI calls my program makes return the error "Returned by WSARecv
> or WSARecvFrom to indicate the remote party has initiated a graceful
> shutdown sequence."
>
> This error remains no matter how many times I recradle or power the
> device on and off. The only way to get rid of the error is to reset
> the device (which doesn't always work), or to restart my application
> (out of the question).
>
> My transfer function calls CeRapiUninit() before exiting, regardless
> of any errors encountered, so I know that the connection /should/ be
> closed. But after closing the connection any call I make returns the
> same error code. To me it looks like RAPI isn't cleaning up after
> itself. I even tried unloading and reloading the DLLs that I use in
> the hopes that the connection to the device would be reset, but to no
> avail.
>
> So my question is this: Is there any way to reinitialize RAPI without
> shutting down the application or resetting the device?
>
>
> Thanks in advance,
> Mars
>