Click here to Skip to main content
13,088,101 members (73,843 online)
Click here to Skip to main content
Add your own
alternative version


28 bookmarked
Posted 3 Oct 2006

Network Connection Manager - Select Network Connections from many Networks Available

, 3 Oct 2006
Rate this:
Please Sign up or sign in to vote.
How to select network connections from many Networks available like BlueTooth, Active Sync, 3G, Wireless Lan


The primary purpose of the article is to centralize and automate the establishment and management of the network connections on a device. Applications on the device use the Connection Manager to establish or schedule a network connection. The Connection Manager handles the details of the connection; the application simply informs the Connection Manager of the network type to use for the connection (the Internet, for example).

When an application requests a network connection, the Connection Manager first retrieves all of the possible connections from a set of Connection Service Providers (CSPs). The Connection Manager then associates a set of costs with these routes and ultimately determines the optimal connection based on cost, latency, bandwidth, and other factors. Finally, the Connection Manager queues the requested connection and uses the CSPs to establish the connection at the appropriate time.

Connection Manager takes care of everything, i.e., all connections are made to networks:

  • "The Internet"
  • "My Corporate Network"

ADD Header file

#include <objbase.h>
#include <initguid.h>
#include <connmgr.h>

In Editor, go to Project>Settings:

Go to Link tab

Object/Library modules: cellcore.lib

Adding Lib


Make the connection

HANDLE hConnection;
connInfo.cbSize = sizeof(connInfo);
connInfo.dwFlags = 0;
connInfo.bExclusive = false;
connInfo.bDisabled = false;
connInfo.guidDestNet = IID_DestNetInternet;
connInfo.hWnd = NULL;
//connInfo.uMsg = WM_APP_CONNMGR;
connInfo.lParam = (LPARAM)0;
// Make the connection
ConnMgrEstablishConnection(&connInfo , &hConnection);

Close the connection

ConnMgrReleaseConnection(hConnection, 1);


  • 3rd October, 2006: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Pradeep Kothari
Systems Engineer
India India
System Programmer in InfoPro Corporation India .
Currently in the Development Team of world's one of the first Mobile Learning Management System.
Can be contacted at

You may also be interested in...

Comments and Discussions

GeneralSource code Pin
imzadi5-Jan-11 13:22
memberimzadi5-Jan-11 13:22 
QuestionHow To Connect 3G network Pin
youcan.zeng19-Aug-09 3:51
memberyoucan.zeng19-Aug-09 3:51 
Questionsource code Pin
Guy in London21-Jan-09 23:15
memberGuy in London21-Jan-09 23:15 
GeneralVB.NET Sample Pin
jorgedf77723-Sep-08 15:24
memberjorgedf77723-Sep-08 15:24 
QuestionCan you send me your source code Pin
alert091915-Jun-08 20:02
memberalert091915-Jun-08 20:02 
GeneralRespect... Pin
Bateman12-Dec-06 6:55
memberBateman12-Dec-06 6:55 
QuestionRe: Respect... Pin
Pradeep Kothari27-May-07 2:35
memberPradeep Kothari27-May-07 2:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170813.1 | Last Updated 4 Oct 2006
Article Copyright 2006 by Pradeep Kothari
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid