locked
Unable to find/connect to device in Windows 7 RRS feed

  • Question

  • Running Windows 7 Ultimate, Visual Studio 2008, with pretty much everything I can find relating to Windows Mobile, including:

    Microsoft Device Emulator
    Windows Mobile 5.0 SDK R2
    Windows Mobile 6 SDK
    Virtual PC 2007
    Windows Mobile Developer Samples

    I've been unable to connect to a running emulator using RAPI/RAPI2/. I've tried the libraries under C:/Program Files (x86)/Microsoft Device Emulator/1.0/Microsoft.DeviceEmulatorManager.Interop.9.0.dll; C:/Windows/WindowsMobile/Microsoft.WindowsMobile.Rapi.dll; the Microsoft sample (CERunApp); and RAPI2.

    I've tried:

    (1)
    Microsoft.WindowsMobile.Rapi.RapiManager mgr =
        Microsoft.WindowsMobile.Rapi.RapiManager.Instance;
    Microsoft.WindowsMobile.Rapi.DeviceCollection dc = mgr.Devices;
    int count = dc.Count;
    // returns 0 for the count

    (2)
    System.Devices.RemoteDeviceManager r= new RemoteDeviceManager();
    RemoteDevice dev = r.Devices.FirstConnectedDevice;
    // returns null

    (3)
    Using [DllImport("rapi.dll")] and calling functions manually (from CERunApp sample):
            RAPIINIT riCopy = new RAPIINIT();
            riCopy.cbsize = Marshal.SizeOf(riCopy);
            hr = CeRapiInitEx(ref riCopy);

            if (SUCCEEDED(hr))
            {
                uint dwRapiInit = 0;
                fInitialized = true;

                dwRapiInit = WaitForSingleObject(
                            riCopy.heRapiInit,
                            dwTimeOut);

    The above call to WaitForSingleObject() returns WAIT_TIMEOUT.

    I've no idea what to do here...nor really any idea of how to figure out what the problem is. I don't get error codes, the event log is bare, it just doesn't do anything.

    Help?!

    Thanks,
    Thomas

    Friday, April 8, 2011 5:32 PM

Answers

  • Is your device connected to the PC by USB cable? Does it appear as a Portable Device in "My Computer"?

    If it is connected, but doesn't appear in "My Computer", try opening device manager and deleting "Network Adapters"->"Microsoft Windows Mobile Remote Adapter". Then disconnect and re-connect your device. It should re-install the drivers and work.

    -PaulH


    Edit: if none of that works, then take a look a "Windows Mobile Device Center Troubleshooting" http://modernnomads.info/wiki/index.php?page=Windows%20Mobile%20Device%20Center%20Troubleshooting

    There are a number of things there you can do that may help.

    • Marked as answer by Jesse Jiang Friday, April 22, 2011 3:49 AM
    Friday, April 8, 2011 7:47 PM

All replies

  • You need to install Windows Mobile Device Center: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=46f72df1-e46a-4a5f-a791-09f07aaa1914

    -PaulH

    Friday, April 8, 2011 6:08 PM
  • You need to install Windows Mobile Device Center: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=46f72df1-e46a-4a5f-a791-09f07aaa1914

    -PaulH


    Already installed; I forgot to mention it in my original post. Thanks though...any other ideas?

    Thomas

    Friday, April 8, 2011 6:48 PM
  • Is your device connected to the PC by USB cable? Does it appear as a Portable Device in "My Computer"?

    If it is connected, but doesn't appear in "My Computer", try opening device manager and deleting "Network Adapters"->"Microsoft Windows Mobile Remote Adapter". Then disconnect and re-connect your device. It should re-install the drivers and work.

    -PaulH


    Edit: if none of that works, then take a look a "Windows Mobile Device Center Troubleshooting" http://modernnomads.info/wiki/index.php?page=Windows%20Mobile%20Device%20Center%20Troubleshooting

    There are a number of things there you can do that may help.

    • Marked as answer by Jesse Jiang Friday, April 22, 2011 3:49 AM
    Friday, April 8, 2011 7:47 PM
  •  

    Hi Thomas,

     

    I'm very interested in hearing more about your issue, did you solve your problem?

    If so please share the solution with us and mark the right answers.

    If not please let me know and I will tray to help you find further solutions.

     

    Have a nice day!

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, April 13, 2011 8:50 AM