Incomplete support for ConnectionManager - Windows CE
This is a discussion on Incomplete support for ConnectionManager - Windows CE ; In the April06 MSDN, the ConnectionManager interface is described, but
I found some undefined types after looking through all the files in
both VS2005 and Platform Builder. Anyone have any ideas whether or not
these exist?
1. typedef enum _ConnMgrConRefTypeEnum ...
-
Incomplete support for ConnectionManager
In the April06 MSDN, the ConnectionManager interface is described, but
I found some undefined types after looking through all the files in
both VS2005 and Platform Builder. Anyone have any ideas whether or not
these exist?
1. typedef enum _ConnMgrConRefTypeEnum { ConRefType_NAP = 0,
ConRefType_PROXY } ConnMgrConRefTypeEnum;
- This is documented in MSDN but does not exist in any header! It's
the first argument to ConnMgrMapConRef().
2. typedef struct _CONNMGR_CONNECTION_DETAILED_STATUS
{
struct _CONNMGR_CONNECTION_DETAILED_STATUS* pNext;
DWORD dwVer;
DWORD dwParams;
DWORD dwType;
DWORD dwSubtype;
DWORD dwFlags;
DWORD dwSecure;
GUID guidDestNet;
GUID guidSourceNet;
TCHAR* szDescription;
TCHAR* szAdapterName;
DWORD dwConnectionStatus;
SYSTEMTIME LastConnectTime;
DWORD dwSignalQuality;
CONNMGR_CONNECTION_IPADDR* pIPAddr;
} CONNMGR_CONNECTION_DETAILED_STATUS;
- Again, is defined in MSDN, but doesn't exist in any header. IN
ADDITION, the CONNMGR_CONNECTION_IPADDR structure is only mentioned and
unfortunately, not defined in MSDN or any header file.
- This is the first argument to ConnMgrQueryDetailedStatus().
3. Both ConnMgrMapConRef() and ConnMgrQueryDetailedStatus() are
similarly UNDEFINED in any header. I can get pointers to them via
LoadLibrary()/GetProcAddr(), but unless the headers support them, do I
just guess at the contents of the CONNMGR_CONNECTION_IPADDDR structure?
Are the missing enum and structure definitions likely to be as
documented in MSDN?
4. Seems that there are always "gotchas" like this when working with
most any part of Windows CE!
-
DOH!
Asked and answered, sort of... I was compiling and linking (C++ in
case I didn't mention it before) with the default Windows Mobile 2003
SDKs. After downloading and installing the WM5.0 PPC and SmartPhone
SDKs, my code compiled and linked correctly. However, the following
are still problems:
1. cellcore.lib does not apparently resolve the GUID references in
connmgr.h (i.e. IID_DestNetInternet, IID_DestNetCorp, etc.). These
require an actual GUID instance somewhere, but the linker isn't finding
them. I still have to copy the value and create a local GUID on the
stack to use when calling ConnMgrEstablishConnectionSync(). Shouldn't
the library export an instance of these GUIDs?
2. There are now four header files to include and not just one.
Strange. To access all Connection Manager API, include the following:
connmgr.h, connmgr_conntypes.h, connmgr_proxy.h, and connmgr_status.h.
Add CellCore.lib to your build and you're off to the races.
3. Question: ConnMgrMapConRef() maps the "name" of a connection to a
GUID that you can use with ConnMgrEstablishConnectionSync() to specify
which connection medium you want to use for the connection, bypassing
Connection Planner. How do you get these "names"? I found the ones on
my device in the registry and sure enough, the required GUID is right
there too. The four listed in connmgr.h are also in the same location.
Is there a programmatic way to find the name of the connection medium
you want such as bluetooth, GPRS, USB, RAS, or whatever? Do you have
to just know the names you want to use, as in, you configure them
yourself beforehand and "hard code" the names into your application?
Knowing the name-to-GUID mapping location in the registry, is there
some other part of the registry that maps the GUID there to the
connection medium type in a recognizable format, possibly an enum or
other numeric type?