Get Outlook contacts from C++ application


Hi,

I need a C++ application to get Outlook contacts (from my local Outlook application)

I found this old example:
https://www.codeproject.com/Articles/3695/Importing-contacts-from-Outlook

But when I try to compile the code in my VS 2017 (once Outlook paths changed to mine) I get some errors in 'msoutl.tlh' file, autogenerated while compilation:

...

\msoutl.tlh(6015): error C3121: cannot change GUID for class 'Folder'

...

error C2556: 'AddressEntryPtr _AppointmentItem::GetOrganizer(void)': overloaded function differs only by return type from '_bstr_t _AppointmentItem::GetOrganizer(void)'

...

error C2371: '_AppointmentItem::GetOrganizer': redefinition; different basic types


Maybe I have something wrong in project configuration...

Any help?

Thanks,
Diego
I'm guessing 15 years, and multiple versions of OS + Compiler + Outlook have contributed to a degree of bit-rot (https://en.wikipedia.org/wiki/Software_rot).

> Microsoft has provided the Outlook Object Model
Perhaps you could follow the same train of thought that led the original author to research how it was done in one language to making something work-a-like in C++.

Posting the same question at multiple forums isn't going to instantly get you help.

https://www.codeproject.com/Questions/5163971/Get-outlook-contacts-from-Cplusplus-application

https://stackoverflow.com/questions/57357519/get-outlook-contacts-from-c-application

You are fighting with source code that is 15-16 years old.

A LOT has changed with the Win32 API since 2003, and MFC has changed as well.

I don't know how well you understand Win32 and MFC, but blindly trying to update OLD source is not for beginners. Up-converting may takes months.
Thanks for your responses.

I posted my question in different forums just because my experience says that sometimes I get help in one forum and another times in another one...

I understand this code is too old, and propably it is not the solution i need for my requirement

Thanks again for spending your time to response
Consider for the future to not spam multiple forums with the same question at the same time.

Post on one forum, and after a couple of DAYS you don't get a response try another single forum.

Spamming multiple forums is considered to be rude.
Last edited on
> I posted my question in different forums just because....
http://www.catb.org/esr/faqs/smart-questions.html#forum
http://www.catb.org/esr/faqs/smart-questions.html#urgent

It's up to you to carefully figure out which forum is best for any given question.

Just broadcasting your question makes it look like you don't care how much of other peoples free time and generosity you waste, and also make it look like you're trying to get an answer fast by posting all over the place.

Trust me, you don't want the regulars on any forum to start mentally tagging you as a serial cross-poster. You'll just get ignored.

My idea with more forums was just to get to more people at the same time (I wish I could wait...). Maybe it is not the best way, I see...

Sorry if the impression was I don't care people time, I really do

I understand what both say, and really thanks for your advise.
Just if usefull for anyone, I found how to compile the code here:
https://docs.microsoft.com/es-es/office/troubleshoot/office-developer/automate-outlook-2010-using-c-with-mfc

Just add to the import line:

... rename("Folder", "OlkFolder") rename("CopyFile", "OlkCopyFile")` rename("GetOrganizer", "GetOrganizerAE")

to avoid the compilation errors
Topic archived. No new replies allowed.