Anyone know anything about MAPI programming/C++?

I’ll preface this by saying that I’m NOT a C++ programmer by trade- it’s just what they have me doing at work, mostly because I’ve programmed in other languages(4GL mostly) and have a CS degree. Until 3 weeks ago, I hadn’t even looked at C++ in 11 years, and certainly not the Microsoft/Windows flavor.

Anyway, the problem I’m having is that I’m reading in MAPI Entryids from a SQL Server table, and they come in as CByteArrays.

My coworker (who has been out for a few days) suggested I put these into a vector<string> via something like:

vectorofentryids.push_back((const char*) vectorofentryids.PR_ENTRYID.GetData(),vectorofentryids.PR_ENTRYID.GetSize()));

and then pass the vector of entryids into my function.

Once I’m in the function, how do I actually translate any of the entries in the vector into an actual MAPI ENTRYID or LPENTRYID, which is needed by most MAPI functions?

I can iterate through the vector, BTW. I just don’t know how to cast or translate that stuff in the vector into anything resembling a LPENTRYID. Nor can I translate the CByteArray into a string- anyone know how to do that? That might help also.

Thanks for any help you can give!

Given a CByteArray named A, you should be able to allocate a character array B of size A.GetSize() and then copy A* to B* for i in [0, A.GetSize() - 1]. Check here for more info.