Synthesis AG - SyncML Discussion Forum  

Go Back   Synthesis AG - SyncML Discussion Forum > Synthesis SyncML Products (english) > Synthesis SyncML SDK - Developers

Reply
 
Thread Tools Display Modes
  #1  
Old 2008-04-15, 13:27
Tej Tej is offline
Junior Member
 
Join Date: 2008-04
Posts: 1
Exclamation Read Access Violation after calling SetStrValue

I am using the SyncML SDK VC++ example to sync from a SyncML Server and I'm experienceing some difficulties with syncing. The SyncML SDK VC++ example, the InitEngineFile() gives 20010 /* error parsing config file */. The modifies version of the syncserv_odbc.xml seems to be fine since if the same xml is used with the SyClient_Demo_win32_3.0.2.2 it is able sync the contacts and the XML file even confirms to WC3 standards.

I'm able continue even after getting the parser error. I do
"err= t->OpenKeyByPath( keyH,NULL, "/profiles",0 );"

then :

"err= t->SetStrValue( subkeyH, "serverURI", "http://sync.xyz.com" );
err= t->SetStrValue( subkeyH, "serverPassword", "test" );"

But calling the any of the below functions causes a Read Access violation:
"
const memSize textbuffersz = 3000;
//memSize textsize;
memSize textsize;
char textbuffer[textbuffersz]={'\0',};

err= t->GetStrValue( subkeyH, "serverURI", s );
err= t->GetValue (fSessionH, "overwrite", VALTYPE_TEXT, (appPointer)textbuffer,textbuffersz, textsize);

err= t->GetValue(fSessionH, "contenttype", VALTYPE_TEXT, (appPointer)textbuffer, textbuffersz, textsize);"

I presume that I need to do these functions before calling:
"char buff[]="<?xml version=\"1.0\" encoding=\"UTF-8\"?><SyncML xmlns='SYNCML:SYNCML1.2'><SyncHdr><VerDTD>1.2</VerDTD><VerProto>SyncML/1.2</VerProto><SessionID>2</SessionID><MsgID>1</MsgID><Target><LocURI>http://sync.xyz.com/</LocURI></Target><Source>...</Source><Cred><Meta><Format xmlns=\'syncml:metinf\'>b64</Format><Type xmlns=\'syncml:metinf\'>syncml:auth-md5</Type></Meta><Data>d6CNybhnUnejXLRuYy7c5g==</Data></Cred><Meta><MaxMsgSize xmlns=\'syncml:metinf\'>20000</MaxMsgSize><MaxObjSize xmlns=\'syncml:metinf\'>4000000</MaxObjSize></Meta></SyncHdr><SyncBody><Get><CmdID>1</CmdID><Meta><Type xmlns=\'syncml:metinf\'>application/vnd.syncml-devinf+xml</Type></Meta><Item><Target><LocURI>./devinf12</LocURI></Target></Item></Get><Alert><CmdID>2</CmdID><Data>200</Data><Item><Target><LocURI>contacts</LocURI></Target><Source><LocURI>./contacts</LocURI></Source><Meta><Anchor xmlns=\'syncml:metinf\'><Last>20080411T111826Z</Last><Next>20080411T113102Z</Next></Anchor><MaxObjSize xmlns=\'syncml:metinf\'>4000000</MaxObjSize></Meta></Item></Alert><Final/></SyncBody></SyncML>\r\n";
appPointer aBuffer=buff;
memSize aValSize=sizeof(buff);
sta = t->WriteSyncMLBuffer(fSessionH, aBuffer, aValSize);
"

If you can please provide a working example OR atleast working settings_test() function which has the correct order of SyncML APIs to sync the syncML data, it would be very helpful.

Thanks,
Tej
Reply With Quote
  #2  
Old 2008-04-23, 15:32
luz's Avatar
luz luz is offline
plan44.ch
 
Join Date: 2006-06
Posts: 348
Default Re: Read Access Violation after calling SetStrValue

This is probably because you are trying to access profile fields, but there is no profile yet. (Of course this should not cause access violations, this will be fixed in the next beta to return a proper error code instead).

Please look at the sample code in the SDK_manual.pdf in the paragraph "5.2.3.1 Preparations before accessing settings profiles", showing how to check if there is a profile and creating a new profile if none already exists.
__________________
Lukas Zeller, plan44.ch
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +2. The time now is 08:24.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.