Title: [MSVC] Error opening a message store

Hi All:

I am trying to open the default message store for some profile using MAPI
suppose I call MAPIInitialize and ScInitMapiUtil and after open a session
i call this function:

BOOL CMapiEngine::OpenMessageStore()
{
//Get the Message stores table...

ASSERT(m_pSession != NULL);
       
IMAPITable*             pMsgStoreTable = NULL;
HRESULT                 hr = NULL;
SPropTagArray*  properties;
unsigned long   ulEntryID;


hr = m_pSession->GetMsgStoresTable(0, (LPMAPITABLE*)&pMsgStoreTable);

if(hr == S_OK){
       
        //Initializes the properties to be retrieved
        properties = (SPropTagArray*)calloc(CbNewSPropTagArray(4), sizeof(char));
        properties->cValues = 4;
        properties->aulPropTag[0] = PR_DISPLAY_NAME;
        properties->aulPropTag[1] = PR_ENTRYID;
        properties->aulPropTag[2] = PR_MDB_PROVIDER;
        properties->aulPropTag[3] = PR_RESOURCE_FLAGS;

        //Set table columns
        hr = pMsgStoreTable->SetColumns((LPSPropTagArray)properties, TBL_ASYNC);

        if(hr == S_OK){
               

                SRestriction restriction;
                restriction.rt = RES_BITMASK;
                restriction.res.resBitMask.relBMR = BMR_NEZ;
                restriction.res.resBitMask.ulPropTag = PR_RESOURCE_FLAGS;
                restriction.res.resBitMask.ulMask = STATUS_DEFAULT_STORE;

                LPSRowSet       prows;

                hr = _HrQueryAllRows(   pMsgStoreTable,                 //the table to query for...
                                        properties,                     //columns defined in the properties array...
                                        (LPSRestriction)&restriction,   //Restrictions defined "Default Message Store"...

                                        NULL,                           //No order...
                                        0,                              //All rows...
                                        &prows                          //pointer to store the rows retrieved...
                                        );

... some other code...
}

when i just call _HrQueryAllRows i got the following error:

Unhandled exception at 0x3553e82b in Mail.exe: 0xC0000005: Access
violation reading location 0x01374008.

And I have already initialized mapi and mapi utils... :-(

Any suggestion????
Thanks in advance
Yosvel
--
  Yosvel
  [EMAIL PROTECTED]

--
http://www.fastmail.fm - I mean, what is it about a decent email service?

Reply via email to