Class ODBPP::Object
Used to represent a data object index within a table.class Object{ public: unsigned short MSN; unsigned int length; union{ unsigned int ID; __int64 ID64; }; unsigned char *fixed; unsigned char *variable; };
Members
MSN | the modified sequence number for the current object. |
length | the total length of the object in bytes from the fixed address. |
ID | the 32 bit Object ID of the current object within the table handles. |
ID64 | the 64 bit Object ID. |
fixed | pointer to the start of the fixed data. |
variable | pointer to the start of the variable data. |
Remarks
Example Use
- C++
#include "ODBPP.h" #define FIRST_TABLE 1 struct FixedObject{ int First; double Second; } *fixedObject; int wmain(int argc, wchar_t* argv[]) { unsigned int error; const char16_t *userName = u"UserName", *message; char16_t buffer[128]; CODBPP::Object object; CODBPP database; if((error = database.BeginTransaction()) == NO_ERROR && (error = database.OpenTable(FIRST_TABLE)) == NO_ERROR && (error = database.ReadObject(FIRST_TABLE, CODBPP::EQUALTO,&object,1,userName)) == NO_ERROR){ fixedObject = (struct FixedObject*)object.fixed; swprintf(buffer,u"First = %d, Second = %g", fixedObject->First, fixedObject->Second); MessageBox(buffer); } if(error && database.GetErrorMessage(&message) == NO_ERROR) MessageBox(message); database.EndTransaction(); return NO_ERROR; }
Also See
AddObject, ReadObjectListen All
Comments (0)