Microsoft KB Archive/232778

= FIX: MIDL Gives Warning MIDL2039 When Decimal Used as Parameter Type in IDL =

Article ID: 232778

Article Last Modified on 12/2/2003

-

APPLIES TO


 * 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
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q232778



SYMPTOMS
When you compile an .idl file with decimal as the type of parameter for a method, you get an MIDL2039 warning. But it is documented that the decimal is a valid type for a parameter (for example, search the MSDN Library Index for "oleautomation").



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

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



Steps to Reproduce the Behavior
  Copy the following code into a new file and save it as an .idl file. import "oaidl.idl"; import "ocidl.idl"; [   object, uuid(DE4C1D8D-C007-11D2-B978-00AA00C0018D), dual, helpstring("IFoo1 Interface"), pointer_default(unique) ] interface IFoo1 : IDispatch { };

[   uuid(DE4C1D80-C007-11D2-B978-00AA00C0018D), version(1.0), helpstring("huh 1.0 Type Library") ] library HUHLib {   importlib("stdole2.tlb");

[       uuid(DE4C1D8F-C007-11D2-B978-00AA00C0018D), hidden, helpstring("_IFoo1Events Interface") ]   dispinterface _IFoo1Events {       properties: methods: [id(1), helpstring("method MIDL2039")] HRESULT MIDL2039([in] Decimal d); };

[       uuid(DE4C1D8E-C007-11D2-B978-00AA00C0018D), helpstring("Foo1 Class") ]   coclass Foo1 {

[default] interface IFoo1; [default, source] dispinterface _IFoo1Events; }; };                     Now compile it with Microsoft Interface Definition Language (MIDL) and see the warning: huh.idl(38) : warning MIDL2039 : interface does not conform to [oleautomation] attribute :  [ Parameter 'd' of Procedure 'MIDL2039' ( Dispinterface '_IFoo1Events' ) ] 

Keywords: kbbug kbfix kbnoupdate kbcompiler KB232778

-

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

© Microsoft Corporation. All rights reserved.