Microsoft KB Archive/196830

= You get a MIDL2039 warning when you compile an .idl file with IFontDisp or IPictureDisp as parameters =

Article ID: 196830

Article Last Modified on 5/26/2005

-

APPLIES TO

 Microsoft ActiveX Template Library 2.1, when used with:  Microsoft Visual C++ 5.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 5.0 Professional Edition

 Microsoft Visual C++ 6.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Standard Edition</li></ul> </li> Microsoft ActiveX Template Library 3.0, when used with:  Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 6.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 5.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q196830

<div class="symptoms_section">

SYMPTOMS
When you compile an .idl file with IFontDisp or IPictureDisp as parameters of methods in Visual C++ 5.0 or Visual C++ 6.0, you get a MIDL2039 warning.

<div class="cause_section">

CAUSE
This is due to a bug in Ocidl.idl source. You must add the dual attribute to the interface declarations for IFontDisp and IPictureDisp.

<div class="resolution_section">

RESOLUTION
To prevent the warning, add the dual attribute to the IFontDisp and IPictureDisp interface declarations in Ocidl.idl, as in the following example: [     object, dual, uuid(BEF6E003-A874-101A-8BBA-00AA00300CAB), pointer_default(unique) ]

interface IFontDisp : IDispatch {     typedef IFontDisp * LPFONTDISP; }

[     object, dual, uuid(7BF80981-BF32-101A-8BBB-00AA00300CAB), pointer_default(unique) ]

interface IPictureDisp : IDispatch {     typedef IPictureDisp * LPPICTUREDISP; }

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

This problem was corrected in Microsoft Visual C++ .NET.

<div class="moreinformation_section">

Steps to Reproduce Behavior

 * 1) Create a new ATL COM AppWizard Project with DLL as the Server Type.
 * 2) Insert a new ATL Control using the ATL Object Wizard, and add the Font stock property by selecting it from the Stock Properties tab of the wizard.
 * 3) Build the .idl file generated by the wizard.

You should receive the following warnings:

warning MIDL2039 : interface does not conform to [oleautomation]

attribute

warning MIDL2039 : interface does not conform to [oleautomation]

attribute

warning MIDL2039 : interface does not conform to [oleautomation]

attribute

Keywords: kberrmsg kbtshoot kbbug kbfix kbnoupdate kbidl kbautomation KB196830

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.