USERNAME PASSWORD LOST PASSWORD? REGISTER
"A Complete Mobile Application Development Environment"
Advertisement

Downloads
Documentation
Forums
Blog
Press
Bug Tracking
Creator IDs
Contact Us




ACCESS Developer Network
Welcome, Guest
Please Login or Register.
Lost Password?
Conduit development: Retrieve application version (1 viewing)
_GEN_GOTOBOTTOM Post Reply Favoured: 0
TOPIC: Conduit development: Retrieve application version
#549
ttimmy (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Conduit development: Retrieve application version 2008/07/08 08:13 Karma: 0  
Hi All.

I see the forums @ http://www.access-company.com/developers/forums/ have ceased to function. I wanted to search for an answer in the archives, but I am unable to.

I have a conduit I wrote using C++.
I want to be able to abort the sync process if the application I have on the palm is below a certain version number.
I checked the documentation for such a function, and I couldn't find one.

Does anybody know if it's possible?
  The administrator has disabled public write access.
#551
ttimmy (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Re:Conduit development: Retrieve application version 2008/07/08 09:00 Karma: 0  
The paragraph in the following URL specifies that the version is stored in a resource record.
As I know i need to specify a string for the SyncOpenDB() command, can anyone direct me how to open the application's resource database in order to retrieve its version number?

http://www.accessdevnet.com/docs/palmos/PalmOSCompanion/UserInterface.html#1011208
  The administrator has disabled public write access.
#566
ttimmy (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Re:Conduit development: Retrieve application version 2008/07/11 19:02 Karma: 0  
I want to thank all of you who've helped me to find the solution...

Code:

      HSByte hDB;     long retval;     CRawRecordInfo rawRecord;     SyncReadOpenDbInfoParams params;     SyncDatabaseInfoType info;     HSError iError;     CCurrentUserRecord currentUser;         CString strReturnValue("ERROR");     bool fFoundVersion;     // Open table "@Sivan"     retval SyncOpenDB("@Sivan"// Table name                         0,                  // Memory card                         hDB,              // Output handle                         eDbRead);     if(retval)     {         m_pLog->LogWarning("Couldn't find @Sivan on palm.");     }     else     {         // Get maximum record size in table         params.bOptFlags SYNC_DB_INFO_OPT_GET_SIZE SYNC_DB_INFO_OPT_GET_ATTRIBUTES SYNC_DB_INFO_OPT_GET_MAX_REC_SIZE;         params.bDbHandle hDB;         iError SyncReadOpenDbInfo(paramsinfo);         // Check if operation was successful         if (!iError && (info.dwMaxRecSize 0))          {             rawRecord.m_TotalBytes info.dwMaxRecSize;         }         else          {             if(iError)             {                 m_pLog->LogWarning("Couldn't find @Sivan on palm.");             }             else             {                 m_pLog->LogWarning("@Sivan on palm is empty.");             }             rawRecord.m_TotalBytes 0;         }         if(rawRecord.m_TotalBytes != 0)         {             // Allocate room for record             rawRecord.m_pBytes = new HSByte[rawRecord.m_TotalBytes];             // Check that the allocation was successful             if(!rawRecord.m_pBytes)             {                 m_pLog->LogWarning("Out of memory.");             }             else             {                 // Fill in data to send to function                 int dCurrentIndex 0;                 rawRecord.m_RecIndex dCurrentIndex++;                 rawRecord.m_FileHandle hDB;                 // Read record from database                 retval SyncReadResRecordByIndex(rawRecord);                 fFoundVersion false;                 // Go through all the records                 while(!retval && !fFoundVersion)                 {                     // If this is the tver record                     if(rawRecord.m_RecId == 'tver')                     {                         // Save version                         strReturnValue rawRecord.m_pBytes;                         // Set flag                         fFoundVersion true;                     }                     else                     {                         // Read next record                         rawRecord.m_RecIndex dCurrentIndex++;                         retval SyncReadResRecordByIndex(rawRecord);                     }                 }             }         }     }     // Close tblCurrentUser     SyncCloseDB(hDB);     return strReturnValue;

  The administrator has disabled public write access.
_GEN_GOTOTOP Post Reply
Powered by FireBoardget the latest posts directly to your desktop


© 2008 ACCESS Developer Network    |    Joomla! is Free Software released under the GNU/GPL License.    |    ACCESS Global Website
Events Support Community Platforms Home