Click here to Skip to main content
15,914,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Serial Com controlling DTR & RTS Pin
Gary R. Wheeler18-Jul-08 15:18
Gary R. Wheeler18-Jul-08 15:18 
AnswerRe: Serial Com controlling DTR & RTS Pin
Luc Pattyn18-Jul-08 15:43
sitebuilderLuc Pattyn18-Jul-08 15:43 
QuestionMakefile question Pin
JoeSox18-Jul-08 6:55
JoeSox18-Jul-08 6:55 
AnswerRe: Makefile question [modified] Pin
Rajkumar R20-Jul-08 21:44
Rajkumar R20-Jul-08 21:44 
QuestionUsing msxml in a visual c++ project Pin
rocktx18-Jul-08 6:33
rocktx18-Jul-08 6:33 
AnswerRe: Using msxml in a visual c++ project Pin
led mike18-Jul-08 7:13
led mike18-Jul-08 7:13 
GeneralRe: Using msxml in a visual c++ project Pin
rocktx18-Jul-08 7:30
rocktx18-Jul-08 7:30 
QuestionExtended MAPI access to calendars Pin
twsmyth18-Jul-08 6:21
twsmyth18-Jul-08 6:21 
Hi,

I'm using Extended MAPI to read and create calendar events in outlook, and as far as it goes, it's working nicely. However, I can only read and write events in the default calendar, but need to be able to access any calendar the user has access to. Here's a brief code snippet showing how I access the calendar (error checking etc removed)...

m_pMAPILogonEx(NULL, NULL, NULL, MAPI_EXTENDED | MAPI_LOGON_UI | MAPI_NEW_SESSION, &pSession);
pSession->GetMsgStoresTable(0, &pStoreTable);
	
// Query the message stores table to get the default store.
SPropTagArray sptaEid = {1, {PR_ENTRYID}};
SRestriction res;
SPropValue spv;
res.rt = RES_PROPERTY;
res.res.resProperty.relop = RELOP_EQ;
res.res.resProperty.ulPropTag = PR_DEFAULT_STORE;
res.res.resProperty.lpProp = &spv;
spv.ulPropTag = PR_DEFAULT_STORE;
spv.Value.b = TRUE;
SYSTEMTIME st;

pHrQueryAllRows( pStoreTable, &sptaEid, &res, NULL, 1, &pRows );
LPSBinary pEntryId = &pRows->aRow[0].lpProps[0].Value.bin;
pSession->OpenMsgStore(0, pEntryId->cb, (LPENTRYID)pEntryId->lpb, NULL, MAPI_BEST_ACCESS, &pStore);

SBinary eidInbox;
pStore->GetReceiveFolder(NULL, 0, &eidInbox.cb, (LPENTRYID*)&eidInbox.lpb, NULL);
pStore->OpenEntry(eidInbox.cb, (LPENTRYID)eidInbox.lpb, NULL, MAPI_BEST_ACCESS, &ulObjType, (LPUNKNOWN*)&pMailbox);

pHrGetOneProp(pMailbox, PR_IPM_APPOINTMENT_ENTRYID, &pCalendarEid);
// Open the calendar and start reading...

The key here is that PR_IPM_APPOINTMENT_ENTRYID gives me the entry id for the default Outlook calendar. But Outlook allows me to create other calendars, and I can see them using OutlookSpy (They appear to be at the same level as the default calendar). I want to access these other calendars, but can't seem to get the entry id in order to open them. I thought I might be able to step through all the entries in the receive folder, and look for entries with PR_CONTAINER_CLASS == "IPM.Appointment", but I get an error if I try to access property PR_CONTAINER_CLASS. Another code snippet...

IMAPITable *pReceiveFolderTable = NULL;
pMailbox->GetContentsTable(MAPI_UNICODE, &pReceiveFolderTable);

SizedSPropTagArray( 2, receiveFolderTableColumns ) = { 2, {PR_ENTRYID, PR_CONTAINER_CLASS} };
hResult = pReceiveFolderTable->SetColumns((LPSPropTagArray)&receiveFolderTableColumns, 0);

SRowSet *pReceiveFolderRows = NULL;
SRow *pReceiveFolderRow = NULL;
hResult = pReceiveFolderTable->QueryRows( 100, &pReceiveFolderRows );
while( ( hResult == S_OK ) && pReceiveFolderRows && pReceiveFolderRows->cRows > 0 )
{

    // Step through the rows, looking for calendars.
    for( ULONG i = 0; i < pReceiveFolderRows->cRows; i++ )
    {
        if( PROP_TYPE( pReceiveFolderRow->lpProps[1].ulPropTag ) != PT_ERROR )
        {
            Write something to log file. Never gets here, as ulPropTag is always PT_ERROR 
        }
    }
}

Does anyone know how I can access these other calendars, or have any suggestions of where I could go for help?

And as if that wasn't enough, I have a second question...

When creating an Outlook appointment, I'd like to supply an email address (or a list of addresses) and have Outlook send an email notification to those addresses. Does anyone know which properties I need to set? And do I need to separately tell Outlook to send the notification, or can it figure that out if set the appropriate properties in the appointment? So far, I've set the named property 0x823b to an email address, and experimented in OutlookSpy with various other fields, but with no success.

Any help or pointers greatly appreciated,

Regards,
Terry Smyth (Got this far, but still a MAPI novice!)
Questionwrite images in pgm format from picturebox (windows forms c++) Pin
william cplus18-Jul-08 4:56
william cplus18-Jul-08 4:56 
QuestionCo-ordinates of a button Pin
bhanu_850918-Jul-08 3:31
bhanu_850918-Jul-08 3:31 
AnswerRe: Co-ordinates of a button Pin
Alan Balkany18-Jul-08 3:54
Alan Balkany18-Jul-08 3:54 
GeneralRe: Co-ordinates of a button [modified] Pin
bhanu_850918-Jul-08 4:20
bhanu_850918-Jul-08 4:20 
GeneralRe: Co-ordinates of a button Pin
Alan Balkany18-Jul-08 4:32
Alan Balkany18-Jul-08 4:32 
GeneralRe: Co-ordinates of a button Pin
bhanu_850918-Jul-08 5:23
bhanu_850918-Jul-08 5:23 
GeneralRe: Co-ordinates of a button Pin
Alan Balkany18-Jul-08 5:42
Alan Balkany18-Jul-08 5:42 
QuestionRe: Co-ordinates of a button [modified] Pin
bhanu_850921-Jul-08 2:21
bhanu_850921-Jul-08 2:21 
AnswerRe: Co-ordinates of a button Pin
Alan Balkany21-Jul-08 4:41
Alan Balkany21-Jul-08 4:41 
GeneralRe: Co-ordinates of a button Pin
bhanu_850923-Jul-08 2:55
bhanu_850923-Jul-08 2:55 
GeneralRe: Co-ordinates of a button Pin
Alan Balkany23-Jul-08 8:08
Alan Balkany23-Jul-08 8:08 
AnswerRe: Co-ordinates of a button Pin
David Crow18-Jul-08 10:06
David Crow18-Jul-08 10:06 
AnswerRe: Co-ordinates of a button Pin
Stephen Hewitt20-Jul-08 13:44
Stephen Hewitt20-Jul-08 13:44 
Questionerror C2026: string too big, trailing characters truncated Pin
Rahul Vaishnav18-Jul-08 2:41
Rahul Vaishnav18-Jul-08 2:41 
AnswerRe: error C2026: string too big, trailing characters truncated Pin
CPallini18-Jul-08 3:06
mveCPallini18-Jul-08 3:06 
GeneralRe: error C2026: string too big, trailing characters truncated Pin
Rahul Vaishnav18-Jul-08 4:03
Rahul Vaishnav18-Jul-08 4:03 
AnswerRe: error C2026: string too big, trailing characters truncated Pin
KarstenK18-Jul-08 3:06
mveKarstenK18-Jul-08 3:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.