Reading Records

Property values can be read from a record using the CeReadRecordPropsEx function. You can choose to read all or some of the properties associated with a record. Listing 4.8 shows how to read all properties from all the records written in the previous section.

Listing 4.8. Reads a record
 void ReadNextDBRecord(HANDLE hDB) { CEOID ceoidRec; DWORD dwBuf; CEPROPVAL *props = NULL; unsigned short lProps; ceoidRec = CeReadRecordPropsEx(hDB, CEDB_ALLOWREALLOC, &lProps, NULL, (LPBYTE*)&props, &dwBuf, NULL); if(ceoidRec == 0) cout ≪ _T("Could not read record") ≪ endl; else { for (int i =0; i < lProps; i++) { switch (props[i].propid) { case propCompany: cout ≪ _T(" Company: ") ≪ props[i].val.lpwstr; break; case propCompanyID: cout ≪ _T(" ...

Get Windows® CE 3.0 Application Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.