Windows Mobile and dmprocessconfigxml instances

Source: Internet
Author: User

These methods are mainly for the first parameter in the dmprocessconfigxml function. For details about how to use the function, see msdn.

Msdn does not explain the first parameter too much. The following provides some examples:

1. Create a cmnet connection

Lpcwstr strfavoritexml =
L "<WAP-provisioningdoc>"
L "<characteristic type = \" cm_uplsentries \ ">"
L "<characteristic type = \" Internet connect \ ">"
L "<parm name = \" destid \ "value = \" {436ef144-b4fb-4863-a041-8f905a62c572} \ "/>"
L "<characteristic type = \" devspecificcellular \ ">"
L "<parm name = \" Maid \ "value = \" cmnet \ "/>"
L "</characteristic>"
L "</characteristic>"
L "</characteristic>"
L "</WAP-provisioningdoc>"; // destid is a self-defined guid. Of course, a defined guid can be directly used.

Lpwstr pszwxmlout = NULL;
Hresult hR = dmprocessconfigxml (strfavoritexml, export flag_process, & pszwxmlout );
If (pszwxmlout)
{
Delete [] pszwxmlout;
Pszwxmlout = NULL;
}

--------------------------------------------------------------------------------
2. Create a cmwap connection

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 = \" Maid \ "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;
}

--------------------------------------------------------------------------------

3. Uninstall the application

Lpctstr szformat =
L "<WAP-provisioningdoc>"
L "<characteristic type =" Uninstall ">"
L "<characteristic type =" [appname] ">"
L "<parm name =" Uninstall "value =" 1 "/>"
L "</characteristic>"
L "</characteristic>"
L "</WAP-provisioningdoc>"
// [Appname] = the name of the software corresponding to the registry is generally the combination of provider and appname in INF used to generate the cab package
// For example, provider = aaa appname = BBB <characteristic type = "aaa bbb"> is then processed using dmprocessconfigxml

--------------------------------------------------------------------------------

4. Disable the hardware ringtone.

Lpctstr szformat =
L "<WAP-provisioningdoc>"
L "<characteristic type =" sounds ">"
L "<characteristic type =" controlpanel \ Sounds \ keypress ">"
L "<parm name =" Mode "value =" 1 "/> <! -- 0 = none, 1 = tone, 2 = click -->"
L "</characteristic>"
L "</characteristic>"
L "</WAP-provisioningdoc>"
// Use the dmprocessconfigxml () function to send the preceding xml configuration data through the Configuration Manager.

--------------------------------------------------------------------------------

5. Create a new email

Lpcwstr strfavoritexml =
L "<WAP-provisioningdoc>"
L "<characteristic type =" email2 ">"
L "<characteristic type =" [guid] ">"
L "<parm name =" servicename "value =" [mailservicename] "/>"
L "<parm name =" servicetype "value =" POP3 "/>"
L "<parm name =" inserver "value =" [popserver] "/>"
L "<parm name =" outserver "value =" [smtpserver] "/>"
L "<parm name =" authname "value =" [alias] "/>"
L "<parm name =" authsecret "value =" [Password] "/>"
L "<parm name =" Domain "value =" [domain] "/>"
L "<parm name =" replyaddr "value =" [emailaddress] "/>"
L "</characteristic>"
L "</characteristic>"
L "</WAP-provisioningdoc>"
// Parameters in [] are custom

--------------------------------------------------------------------------------

6. Create a Wi-Fi connection

// This XML will add or overwrite a Wi-Fi access point connection with SSID cowo, no encryption, Open Authentication.
// This connection is regarded as an Internet connection.

Lpcwstr in = \
L "<WAP-provisioningdoc>"
L "<characteristic type = \" Wi-Fi \ ">"
L "<characteristic type = \" Access-point \ ">"
L "<characteristic type = \" cowo \ ">"
L "<parm name = \" destid \ "value = \" {436ef144-b4fb-4863-a041-8f905a62c572} \ "/>"
L "<parm name = \" adhoc \ "value = \" 0 \ "/>"
L "<parm name = \" authentication \ "value = \" 0 \ "/>"
L "<parm name = \" Encryption \ "value = \" 1 \ "/>"
L "<parm name = \" keyprovided \ "value = \" 0 \ "/>"
L "<parm name = \" networkkey \ "value = \" \ "/>"
L "<parm name = \" keyindex \ "value = \" 1 \ "/>"
L "<parm name = \" use8021x \ "value = \" 0 \ "/>"
L "<parm name = \" eaptype \ "value = \" 25 \ "/>"
L "</characteristic>"
L "</characteristic>"
L "</characteristic>"
L "</WAP-provisioningdoc> ";

--------------------------------------------------------------------------------

7. enumerate wi-fi connection points

// There are some M $ examples about recursive query of all WiFi connections.
// Here's an example on how to query a specific connection.

Lpcwstr in =
L "<WAP-provisioningdoc>"
L "<characteristic type = \" Wi-Fi \ ">"
L "<characteristic type = \" Access-point \ ">"
L "<characteristic-query type = \" cowo \ "/>"
L "</characteristic>"
L "</characteristic>"
L "</WAP-provisioningdoc> ";

--------------------------------------------------------------------------------

3. Obtain the access point of a connection.

Lpctstr szformat =
L "<WAP-provisioningdoc>"
L "<characteristic type = \" cm_uplsentries \ ">"
L "<characteristic type = \" % s \ ">"
L "<characteristic type = \" devspecificcellular \ ">"
L "<parm-query name = \" Maid \ "/>"
L "</characteristic>"
L "</characteristic>"
L "</characteristic>"
L "</WAP-provisioningdoc> ";
// % S is "Mobile Dream network (GPRS)" "GPRS connected to the Internet,
// You can use connmgrquerydetailedstatus to enumerate the szdescription of connmgr_connection_detailed_status.

From: http://blog.csdn.net/lianghuating/archive/2009/03/25/4022486.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.