Connection Manager setup

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello all
i posted this question in microsoft.public.pocketpc.developer and i got
little help
then i found this group which seems like the wireless group

i have a small application that uses WinInet to download files from a
web server
the application works fine when the phone is cradled/on the emulator
(WM 5.0 SP/PPC)

when the deploy the application to the phone and its not cradled, i
don't seem to have an Internet connection unless i have Internet
Explorer running in the background :-(


I do have a data plan on my GSM phone, i can access my email/the web
etc.


if i close IE my app can't access the server no more and InternetOpen
will succeed while InternetOpenUrl will fail.


i have the following code to establish connection to the connection
manager, the call to ConnMgrEstablishConnectionSync() fails all the
time so i used
ConnMgrEstablishConnection() instead which succeeds on both cases
(phone cradled and not cradled)


Regards
Mo


<code>
HRESULT hr = 1;
BOOL bResult = TRUE;
HANDLE hConnMgr = ConnMgrApiReadyEvent();
GUID guidNetworkObject;
CONNMGR_CONNECTIONINFO connectionInfo = {0};


//Check hresult returned by ConnMgrMapURL() to make sure the
network id is valid.
//The ConnMgrMapURL function maps a URL to the globally unique
identifier
//(GUID) of the network to which the device is connected.
hr = ConnMgrMapURL(TEXT("http://www.msn.com";),
&guidNetworkObject, NULL);
if (FAILED(hr))
{


printf("Failed to MapURL %d****",GetLastError());


}


connectionInfo.cbSize = sizeof(CONNMGR_CONNECTIONINFO);
connectionInfo.guidDestNet =
guidNetworkObject;//IID_DestNetInternet;
connectionInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET
| CONNMGR_PARAM_MAXCONNLATENCY;//CONNMGR_PARAM_GUIDDESTNET;
connectionInfo.dwFlags = CONNMGR_FLAG_PROXY_HTTP;
connectionInfo.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE;
connectionInfo.bExclusive = FALSE;
connectionInfo.bDisabled = FALSE;
connectionInfo.hWnd = NULL;
connectionInfo.uMsg = 0;
connectionInfo.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE;


HANDLE hConn = NULL;


hr=ConnMgrEstablishConnection(&connectionInfo, &hConn);
if (FAILED(hr))
{


printf("Failed to Connect %d****",GetLastError());
}
else
{
printf("Connected ****");
}
/*
this call fails all the time
hr = ConnMgrEstablishConnectionSync(&connectionInfo, &hConnMgr,
30000, &dwStatus);
if (FAILED(hr) || dwStatus != CONNMGR_STATUS_CONNECTED)
{
OutputDebugString(TEXT("ConnMgrEstablishConnectionSync failed"));
printf("Last Error: %d...\r\n", GetLastError());
return FALSE;
}*/


m_fIsConnected=TRUE;


_hOpenHandle = InternetOpen(szAgent,INTERNET_OPEN_TYPE_DIRECT,
NULL,
NULL, NULL);
if(NULL == _hOpenHandle)
{
//error handling here
return FALSE;
}


//open the file
_hResourceHandle = InternetOpenUrl(_hOpenHandle
,szServerURL,
NULL, 0, INTERNET_FLAG_RAW_DATA , 0);
if (NULL ==_hResourceHandle)
{
//error handling here
return FALSE;
}


......


}


</code>

.



Relevant Pages

  • Connection Manager: application cannot access the internet
    ... the application works fine when the phone is cradled/on the emulator ... don't seem to have an Internet connection unless i have Internet ... //The ConnMgrMapURL function maps a URL to the globally unique ...
    (microsoft.public.pocketpc.developer)
  • RE: Connection Manager: application cannot access the internet
    ... device using the internet via the Host PC. ... But, when the device is out of the cradle, make sure the device is either ... don't seem to have an Internet connection unless i have Internet ... //The ConnMgrMapURL function maps a URL to the globally unique ...
    (microsoft.public.pocketpc.developer)
  • Re: What does the "Configure email and Internet Connection Wizard"
    ... > the CEICW does (listed under "Configure Email and Internet Connection ... > Configure E-mail and Internet Connection Wizard is designed to correctly ... > configure settings for your network, firewall, secure Web site, and e-mail ...
    (microsoft.public.windows.server.sbs)
  • Re: What does the "Configure email and Internet Connection Wizard"
    ... Understanding the Configure E-mail and Internet Connection WizardThe ... Configure E-mail and Internet Connection Wizard is designed to correctly ... configure settings for your network, firewall, secure Web site, and e-mail ...
    (microsoft.public.windows.server.sbs)
  • Re: Serious Security Issue in Windows XP SP2s Firewall
    ... Subject: AW: Serious Security Issue in Windows XP SP2's Firewall ... If you update a WinXP SP-1 with enabled Internet ... Connection Firewall ...
    (Focus-Microsoft)