I have written a very simple Inventory Tracking application for a Motorola MC3190 Mobile Device. I need to transfer data to and from the device and a Windows 7 PC.
I have scoured the internet for options on how to do this but so far nothing has worked. I am very new to developing Mobile applications and have limited knowledge of C#. (Just enough to develop a simple data capture app).
I have downloaded and installed the Windows Mobile Device Center, Windows Mobile 6 SDK and OpenNETCF Smart Device Framework to get access to RAPI. I know the Remote Device is connected properly through the Windows Mobile Device Center and VS2008 is able to deploy my solution to the device. I can also copy files back and forth manually via the Windows Mobile Device Center.
What I have tried so far is:
Add a OpenNetCF.Desktop.Communications Refernce
Used Code as follows:
        using (RAPI rapi = new RAPI())  <--- Error Occurs (Cannot Find PInvoke.dll in RAPI.dll)
        {
            rapi.Connect(true);
            rapi.CopyFileToDevice(remote_file, local_file);
            rapi.Disconnect();
        }
I get the error (Cannot Find PInvoke.dll in RAPI.dll) when creating a new RAPI Instance because it appears to be trying to use ActiveSync. I cannot load ActiveSync because I am running Windows 7.
I have tried adding the following code:
    [DllImport("rapi.dll")]
    static extern int CeRapiInit();
and then calling
        var rapi = CeRapiInit() == ERROR_SUCCESS;  <-- Return Value is -2147024770
        if (!rapi)
            return;
        try
        {
          .. Somestuff
        }
        finally
        {
            CeRapiUninit();
        }
It appears that RAPI cannot find the remote device. I have looked at some options for pget and pput functions but they also crap out on the CeRapiInit call. Perhaps I may not be able to use RAPI at all
Any help would be appreciated.