COleVariant's and globally unique ID's
-
Background... I'm using the msado15.dll ADO type library for database access. I'm using a class derived from CADORecordBinding to bind to a _RecordsetPtr object, which I'm using to update a list view with. The class is given below. I'm currently reading the MailID field out of the database as an adVariant type, but it's actually an adGUID type. The reason I'm reading as an adVariant, is that I'm not sure how to store an adGUID type as a c/c++ variable. I'm a bit new to all this, so please forgive my greenness! Destroying the CMessageHeadersCache Object... You'll notice that there are COleVariant member variables in the CMessageHeadersCache class. When I call delete on objects this class, the program crashes! When the COleVariant member variables are absent, deallocation goes just fine! I'm sure that there must be some safe/correct/appropriate way of deallocating these objects containing COleVariants, but I'm a bit stuck! Please help! Many thanx, funBag #pragma once #include "icrsint.h" // ============================================================================ // Class CMessageHeadersCache // Purpose ADO Record binding for the Messsage Headers list view object. // History funbag 24th March 2002 Initial Rev. // ============================================================================ class CMessageHeadersCache : public CADORecordBinding { public: CMessageHeadersCache(); ~CMessageHeadersCache(); BEGIN_ADO_BINDING(CMessageHeadersCache) // DateTimeReceived ADO_VARIABLE_LENGTH_ENTRY2(1, adVariant, DateTimeReceived, sizeof(DateTimeReceived), status[0], FALSE) ADO_VARIABLE_LENGTH_ENTRY2(2, adVarChar, SenderMailAddress, sizeof(SenderMailAddress), status[1], FALSE) ADO_VARIABLE_LENGTH_ENTRY2(3, adVarChar, SubjectLine, sizeof(SubjectLine), status[2], FALSE) ADO_VARIABLE_LENGTH_ENTRY2(4, adVarChar, Opened, sizeof(Opened), status[3], FALSE) ADO_VARIABLE_LENGTH_ENTRY2(5, adVariant, MailID, sizeof(MailID), status[4], FALSE) END_ADO_BINDING() public: COleVariant DateTimeReceived; char SenderMailAddress[100]; char SubjectLine[1024]; char Opened[2]; COleVariant MailID; ULONG status[5]; };:(( skydiving....if at fir