I have written a program to export the address contacts from a user's Microsoft Outlook contacts folder. I am using the Outlook 10.0 COM Object to access the user's contacts. In particular, I am reading IContactItem and using the get_Email1Address() method. This works fine for most contacts (type 'SMTP). However, when reading from a Global Contact List [from an Exchange server], the contact's type becomes 'EX' and the result from get_Email1Address becomes an x.500-like string: "/O=company/OU=North America/cn=Recipient/cn=12312" When this happens, I need to resolve this x.500-like string into an SMTP email address. I have looked at the Microsoft KB articles: KB 196507: HOWTO: Retrieve Alternate E-mail Addresses Using CDO KB 248357: HOWTO: Retrieve Alternate E-mail Addresses Using Extended MAPI I am trying to use the MAPI interface to resolve the contacts using the ResolveName(...) and GetProps() methods as indicated in the included code snippet. However, this is not working correctly. In particular, the ResolveName call either fails, or the GetProps call fails.
1) I am looking for a C/C++ function that correctly resolves the x.500-like string into an SMTP address. A potential solution can either use the Outlook object directly, CDO, or MAPI, or simply debug the problem with the code above. The program or function snippet to replace the code above should be written in C++ and it should compile on Visual Studio .NET. If you write a stand-alone program, it should take as input the X.500-style string and print out the SMTP address. Please provide a project file that compiles the program. If you simply debug the code above, set the variable 'second' to the resolved SMTP address.
2) We will test the program or code snippet against our exchange 2003 server to make sure that the code works for our particular case.
3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).
Windows XP, MFC, Visual C++