views:

427

answers:

1

On a Windows Mobile 6 device we are trying to open an internet connection. This usually works but sometimes we get a return code of 0x80004005 with a status of CONNMGR_STATUS_NOPATHTODESTINATION. When this happens it will keep happening but if you launch IE on the device, it will connect and then our call to ConnMgrEstablishConnectionSync works. We have not been able to isolate what causes this to happen, it currently appears to be random (though I suspect it isn't). Any hints?

Our code looks basically like this:

CONNMGR_CONNECTIONINFO  connInfo;
DWORD                   dwStatus = 0;

memset(&connInfo, 0, sizeof(connInfo));
connInfo.cbSize = sizeof(connInfo);
connInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;
connInfo.dwFlags = CONNMGR_FLAG_NO_ERROR_MSGS;
connInfo.dwPriority = CONNMGR_PRIORITY_HIPRIBKGND;
connInfo.guidDestNet = IID_DestNetInternet; /* Connect to the "Internet" network */

hr = ConnMgrEstablishConnectionSync(&connInfo, &s_hConnection, 120 * 1000, &dwStatus);
A: 

Windows Mobile connection manager is a huge PITA. Do you get the same error if you specify the network address by IP (e.g. "255.255.255.255/whatever") instead of by server name?

My guess is you could reproduce the lack-of-connection on demand with one of these methods:

  • Clearing the history in IE on the WM device
  • Closing IE from the running programs screen (in other words, really removing it from memory)
  • Soft resetting the device
MusiGenesis