From: gozer61 on
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!

From: " ctacke/>" on
Let's start with #3 in your list. I look in MSDN for "ConnMgrMapConRef" and
I get this page:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/wce51grfConnMgrMapConRef.asp

The definition is right there. In addition, it tells me at the bottom of
that page that the header is conmgr.h and the link library is cellcore.lib.
At the top of the page it says it's part of the Windows Mobile 5.0 SDK.

So next I go to the SDK, which on my machine is at
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK

If I go down into the Include subfolder, I do indeed find conmgr.h, and at
line 447 I find ConnMgrMapConRef.

Dumpbin on cellcore.lib also turns up the function.

I didn't look for the others, but my guess is that you're just looking in
the wrong place.

-Chris


> 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!
>


From: gozer61 on

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?