Hi All,
Now I can get sync state from HKEY_LOCAL_MACHINE\\System\\State\\Active\\Synchronizing. But how can I get the detail sync properties. For example, which type data are synchoronizing? Contact? Task? Email? Or Appointment?
- It is currently Wed May 22, 2013 5:32 am • All times are UTC + 2 hours
How can I get current active sync properties?
9 posts
• Page 1 of 1
You can use the device configuration API to get sync information
from ActiveSync. You can also configure AS sync settings with
this API. Search for DMProcessConfigXML() function and the
XML syntax for this function.
Houser
from ActiveSync. You can also configure AS sync settings with
this API. Search for DMProcessConfigXML() function and the
XML syntax for this function.
Houser
- Houser
- TEK-Seeker
- Posts: 17
- Joined: Mon Nov 13, 2006 2:11 pm
- Location: Germany
Hi, Raul
I have read your link document but still some problem I understand.
1. CFGFLAG_PROCESS- Boolean value helps to write data into the OMA DM Management tree.
CFGFLAG_METADATA- Boolean value helps to read data from the OMA DM Management tree. Is this right?
2. Can you please show an example code on how to use the DMProcessConfigXML() API with CFGFLAG_METADATA to read value?
Best wishes,
Fei
If you carefully read the SDK help :
In Windows Mobile 5.0 and later, you can call DMProcessConfigXML from within the setup DLL file of a .cab file.
The caller of DMProcessConfigXML is responsible for cleanup of the output buffer that the ppszwXMLout parameter references. Memory is allocated in the implementation by means of the new [] operator. Thus the caller must use the delete [] <varname> statement to free the output buffer.
Note If DMProcessConfigXML retrieves a document, the caller should parse the document for errors.
The Configuration Manager component is transactional and must process only one configuration request at a time to prevent collisions. Therefore, the DMProcessConfigXML function processes only one XML configuration request at a time.
So you need to fill pszWXMLin with the query XML and wait for the response in ppszwXMLout.
HRESULT hr = E_FAIL;
LPWSTR wszOutput = NULL;
// Process the XML.
hr = DMProcessConfigXML(g_wszXml, CFGFLAG_METADATA, &wszOutput);
//Process returned string -> wszOutput
// The caller must delete the XML returned from DMProcessConfigXML.
delete [] wszOutput;
You can fill g_wszXml using string.h APIs (_tcscat, etc) or read it from a file
For a complete list of how the XML should look like consult
http://msdn.microsoft.com/library/defau ... rovdtd.asp
Cheers,
Raul
- sad_ghost
- TEK-Giant

- Posts: 269
- Joined: Thu Apr 06, 2006 11:04 am
Hi, Raul
Thank for your quick response at first.
It seems that I can't describe my question clearly. Sorry.
My trouble is that I don't know what is the query XML, and what difference between question XML and process XML.
For example, If I have added a link to favorite. The inplut xml as following.
Now I want to get this link information. I replace CFGFLAG_PROCESS to CFGFLAG_METADATA.
The problem is : How to write the query XML?
What rule with it ?
Best wishes,
Fei
Thank for your quick response at first.
It seems that I can't describe my question clearly. Sorry.
My trouble is that I don't know what is the query XML, and what difference between question XML and process XML.
For example, If I have added a link to favorite. The inplut xml as following.
- Code: Select all
LPCWSTR g_wszFavoriteXml =
L" <wap-provisioningdoc> "
L" <characteristic type=\"BrowserFavorite\"> "
L" <characteristic type=\"MSN Search\"> "
L" <parm name=\"URL\" value=\"http://search.msn.com/\"/> "
L" </characteristic> "
L" </characteristic>"
L" </wap-provisioningdoc>";
Now I want to get this link information. I replace CFGFLAG_PROCESS to CFGFLAG_METADATA.
The problem is : How to write the query XML?
What rule with it ?
Best wishes,
Fei
- swordsmile
- TEK-Seeker
- Posts: 21
- Joined: Wed Dec 06, 2006 10:35 am
My query xml is following:
But the return code is 0x80042009. Why?
- Code: Select all
LPCWSTR g_wszFavoriteXml =
L"<wap-provisioningdoc> "
L" <characteristic type=\"BrowserFavorite\"> "
L" <characteristic type=\"MSN Search\"> "
L" <parm-query name=\"URL\"> "
L" </characteristic> "
L" </characteristic>"
L"</wap-provisioningdoc>";
...
hr = DMProcessConfigXML(g_wszFavoriteXml, CFGFLAG_METADATA, &wszOutput);
But the return code is 0x80042009. Why?
- swordsmile
- TEK-Seeker
- Posts: 21
- Joined: Wed Dec 06, 2006 10:35 am
Do not use the CFGFLAG_METADATA flag, use the CFGFLAG_PROCESS
flag instead then it should work.
Here is an example XML that I use for my query:
Houser
flag instead then it should work.
Here is an example XML that I use for my query:
- Code: Select all
const TCHAR XML_SYNC_ENABLE_QUERY[] = TEXT("<wap-provisioningdoc><characteristic type=\"Sync\">\
<characteristic type=\"Mail\">\
<parm-query name=\"Enabled\"/>\
</characteristic>\
<characteristic type=\"Calendar\">\
<parm-query name=\"Enabled\"/>\
</characteristic>\
<characteristic type=\"Contacts\">\
<parm-query name=\"Enabled\"/>\
</characteristic>\
</characteristic></wap-provisioningdoc>");
Houser
- Houser
- TEK-Seeker
- Posts: 17
- Joined: Mon Nov 13, 2006 2:11 pm
- Location: Germany
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest