0

I am using the following code to update the APN settings on a Windows Mobile MC67 device:

XmlDocument configDoc = new XmlDocument();
configDoc.LoadXml(
      "<wap-provisioningdoc>" +
        "<characteristic type=\"CM_GPRSEntries\">" +
           "<characteristic type=\"Connection_Name\">" +                      
              "<parm name=\"UserName\" value=\"web\"/>" +
              "<parm name=\"Password\" value=\"web\"/>" +
              "<characteristic type=\"DevSpecificCellular\">" +
                 "<parm name=\"GPRSInfoAccessPointName\"  value=\"APN_Value\" />" +
              "</characteristic>" +
           "</characteristic>" +
        "</characteristic>" +
      "</wap-provisioningdoc>"
);
ConfigurationManager.ProcessConfiguration(configDoc, false);

It updates the APN value, but doesn't apply it until I click on Edit APN and Save thereafter. Does anyone have any idea?

SnapADragon
  • 536
  • 7
  • 21
  • Maybe you need to use DMProcessConfig() directly. Or let the device know of the change: warmboot or broadcast a WININICHAGED message. – josef Mar 25 '16 at 06:18
  • How can I use DMProcessConfigXML() method in my code, as its not available with current libraries? Also, It would be great if you could point to a working fiddle. Thanks. – SnapADragon Mar 30 '16 at 14:10
  • DMProcess Config is the same (native) as what you use. So you need the system know that you made changes by using PostMessage() (pinvoke) with WININICHANGED or WM_SETTINGCHANGE (see http://www.pinvoke.net/default.aspx/Enums.WindowsMessages). – josef Apr 04 '16 at 17:09

0 Answers0