MsOutl.olb import fails due to similar overloads functions

MyRo 21 Reputation points
2021-11-03T08:39:22.12+00:00

when importing in a C++ project MsOutl.OLB Created 30/10/2021 17:09
with

import "msoutl.olb" IMPPROPS rename ("Application", "adoApplication") rename ("CopyFile", "OutlookCopyFile") rename ("PlaySound", "OutlookPlaySound") rename("GetOrganizer", "GetOrganizerAddressEntry")

It complains with

msoutl.tlh(21666): error C2556: 'Outlook::OlMeetingProvider Outlook::_AppointmentItem::GetOnlineMeetingProvider(void)': overloaded function differs only by return type from 'HRESULT Outlook::_AppointmentItem::GetOnlineMeetingProvider(void)'
msoutl.tlh(21665): note: see declaration of 'Outlook::_AppointmentItem::GetOnlineMeetingProvider'
msoutl.tlh(21666): error C2371: 'Outlook::_AppointmentItem::GetOnlineMeetingProvider': redefinition; different basic types
msoutl.tlh(21665): note: see declaration of 'Outlook::_AppointmentItem::GetOnlineMeetingProvider'
msoutl.tlh(21665): error C3803: 'Outlook::OlMeetingProvider Outlook::_AppointmentItem::OnlineMeetingProvider': property has a type which is incompatible with one of its accessors 'HRESULT Outlook::_AppointmentItem::GetOnlineMeetingProvider(void)'
msoutl.tlh(21278): note: see declaration of 'Outlook::_AppointmentItem::OnlineMeetingProvider'
msoutl.tlh(21665): note: see declaration of 'Outlook::_AppointmentItem::GetOnlineMeetingProvider'
msoutl.tlh(30985): error C2556: 'Outlook::OlMeetingProvider Outlook::_AppointmentItem::GetOnlineMeetingProvider(void)': overloaded function differs only by return type from 'HRESULT Outlook::_AppointmentItem::GetOnlineMeetingProvider(void)'
msoutl.tlh(21665): note: see declaration of 'Outlook::_AppointmentItem::GetOnlineMeetingProvider'
msoutl.tlh(30985): error C2371: 'Outlook::_AppointmentItem::GetOnlineMeetingProvider': redefinition; different basic types
msoutl.tlh(21665): note: see declaration of 'Outlook::_AppointmentItem::GetOnlineMeetingProvider'

In the created msoutl.tlh one finds eg.

at line 21665:

HRESULT GetOnlineMeetingProvider ( );
enum OlMeetingProvider GetOnlineMeetingProvider ( );
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
0 comments No comments
{count} votes

Answer accepted by question author
  1. Wim Bonner 76 Reputation points
    2021-11-04T19:26:16.3+00:00

    I was able to get my code to move past that error by including the raw_interfaces_only attribute on the import command. https://learn.microsoft.com/en-us/cpp/preprocessor/raw-interfaces-only?view=msvc-160

    Unfortunately for me, I'm getting a bunch of new errors on my code now


2 additional answers

Sort by: Most helpful
  1. Jenny 1 Reputation point
    2021-11-13T19:19:47.807+00:00

    I am unable to resolve my issue. Before it is running well in my C++ Project. But all of sudden it gives me a same error. Below is my code for the import library.

    import "C:\Program Files (x86)\Microsoft Office\root\VFS\ProgramFilesCommonX86\Microsoft Shared\OFFICE16\MSO.DLL" no_namespace, rename("DocumentProperties", "DocProps"), rename("DocumentProperties", "DocumentPropertiesOL"), rename("RGB", "RBGOL"), rename("IAccessible", "IAccesibleXL")

    import "C:\Program Files (x86)\Microsoft Office\root\Office16\MSOUTL.OLB" rename_namespace("Outlook"), rename("CopyFile", "CopyFileOL"), rename("PlaySound", "PlaySoundOL"), rename ("GetOrganizer", "GetOrganizer1")

    Anyone can help to fix this.?

    0 comments No comments

  2. MyRo 21 Reputation points
    2021-11-10T13:43:56.493+00:00

    Thank you for your answer:

    import "mso.dll" IMPPROPS rename ("RGB", "OfficeRGB") rename ("SearchPath", "OfficeSearchPath") rename ("DocumentProperties", "OfficeDocumentProperties")

    import "msoutl.olb" IMPPROPS rename ("Application", "adoApplication") rename ("CopyFile", "OutlookCopyFile") rename ("PlaySound", "OutlookPlaySound") rename("GetOrganizer", "GetOrganizerAddressEntry") rename ("Folder", "OutlookFolder")

    did the job for me.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.