"Specified procedure could not be found"

J

joelcochran

I am trying to use OpenNETCF.Desktop.Communications to copy a file from
my PC to my Device. I have a Windows Application solution that
includes the OpenNETCF.Desktop.Communications project and references
its output. The app compiles and executes, but throws the following
runtime error on the CopyFileToDevice() method:

"Could not create remote file Specified procedure could not be found"

I tracked it into RAPI.cs and the error is thrown on
<code>
remoteFile = CeCreateFile(RemoteFileName, GENERIC_WRITE, 0, 0, create,
FILE_ATTRIBUTE_NORMAL, 0);
</code>

It seems that a reference or something is missing, but why would it
compile? Is there something more I should have installed? Is there
perhaps a runtime or something missing on the device? I just don't
know where to look next...

Thanks,

Joel
 
J

joelcochran

I thought of that in the shower this morning... I remembered reading
that rapi needs to use RapiInit or RapiInitEx, and so I figured I just
missed something.

Just for the archives, I added a call to Connect() and it corrected the
problem. Here is the working code:

<code>
RAPI device = new RAPI();
device.Connect( false , 10 );
if ( device.Connected )
{
device.CopyFileToDevice( localFileName , remoteFileName , true );
device.Disconnect();
}
</code>

Thanks for the response!
 

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