If you want to use HTTP or socket to connect to the server in the program, you need to connect to the network first. The connmgr_connectioninfo parameter in the connmgrestablishconnectionsync function depends on the Access Point settings on the mobile phone no matter whether iid_destnetwap or iid_destnetinternet is used. China Mobile has to deal with cmnet, cmwap, and communication companies with Chinese characteristics.
You can create an access point on your own. Run the following code to create a cmwap access point:
Cstring strfavoritexml =
L "<WAP-provisioningdoc>"
L "<characteristic type =/" cm_networks/">"
L "<characteristic type =/" test_gprs/">"
L "<parm name =/" destid/"value =/" {D1D06580-C364-55ec-9421-6ACF34129C58}/"/>"
L "</characteristic>"
L "</characteristic>"
L "<characteristic type =/" cm_uplsentries/">"
L "<characteristic type =/" test_gprs/">"
L "<parm name =/" destid/"value =/" {D1D06580-C364-55ec-9421-6ACF34129C58}/"/>"
L "<characteristic type =/" devspecificcellular/">"
L "<parm name =/" bearerinfovalid/"value =/" 1/"/>"
L "<parm name =/" maid/"value =/" 1/"/>"
L "<parm name =/" maid/"value =/" 2/"/>"
L "<parm name =/" maid/"value =/" PPP/"/>"
L "<parm name =/" maid/"value =/" cmwap/"/>"
L "<parm name =/" maid/"value =/"/"/>"
L "<parm name =/" maid/"value =/" 1/"/>"
L "<parm name =/" maid/"value =/" 1/"/>"
L "<parm name =/" uplsinfoparameters/"value =/"/"/>"
L "</characteristic>"
L "</characteristic>"
L "</characteristic>"
L "<characteristic type =/" cm_proxyentries/">"
L "<characteristic type =/" WAP/">"
L "<parm name =/" srcid/"value =/" {D1D06580-C364-55ec-9421-6ACF34129C58}/"/>"
L "<parm name =/" destid/"value =/" {436ef144-b4fb-4863-a041-8f905a62c572}/"/>"
L "<parm name =/" Proxy/"value =/" 10.0.0.172: 80/"/>"
L "<parm name =/" Enable/"value =/" 1/"/>"
L "<parm name =/" type/"value =/" 1/"/>"
L "</characteristic>"
L "</characteristic>"
L "</WAP-provisioningdoc> ";
Lpwstr pszwxmlout = NULL;
Hresult hR = dmprocessconfigxml (strfavoritexml, export flag_process, & pszwxmlout );
If (pszwxmlout)
{
Delete [] pszwxmlout;
Pszwxmlout = NULL;
}