question about midl compiler 
Author Message
 question about midl compiler

when i use midl to compile an "idl" file, i found the name of some coclass
or function has been changed to lowercase.
eg:
the source idl file:
 [
  uuid(FB3804D8-EFE7-425f-86B4-13356F606E97),
  version(1.0)
 ]
 coclass PView
 {
  interface IPView;
  [default, source] dispinterface _IPViewEvents;
  [default] interface IUnknown;
 };

[
 object,
 uuid(441C65FA-71B4-4e2d-8385-5DC08CACB591),
 version(1.0),
 pointer_default(unique)
]
interface IPNewLine : IUnknown
{
 HRESULT _stdcall Finish ();

Quote:
};

after been compiled, "coclass PView" has been changed to "coclass pview",
and function "Finish" has been changed to "finish".
Why?


Sun, 27 Feb 2005 11:17:17 GMT  
 question about midl compiler
IIRC I've seen similar problem reported when interfaces had parameters
with the same names as coclasses except for case. You see, type library
is case-insensitive, and it contains a symbol table listing all symbols
without duplication. The format of the table does not allow keeping both
pview and PView, so MIDL picks the spelling it first encounters, and
uses it throughout.

The workaround is either to be consistent in capitalization, or to avoid
using conflicting identifiers.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> when i use midl to compile an "idl" file, i found the name of some
coclass
> or function has been changed to lowercase.
> eg:
> the source idl file:
>  [
>   uuid(FB3804D8-EFE7-425f-86B4-13356F606E97),
>   version(1.0)
>  ]
>  coclass PView
>  {
>   interface IPView;
>   [default, source] dispinterface _IPViewEvents;
>   [default] interface IUnknown;
>  };

> [
>  object,
>  uuid(441C65FA-71B4-4e2d-8385-5DC08CACB591),
>  version(1.0),
>  pointer_default(unique)
> ]
> interface IPNewLine : IUnknown
> {
>  HRESULT _stdcall Finish ();
> };

> after been compiled, "coclass PView" has been changed to "coclass
pview",
> and function "Finish" has been changed to "finish".
> Why?



Sun, 27 Feb 2005 23:41:00 GMT  
 question about midl compiler
Thanks Igor. I've found there are a few parameters of interface method
conflicted with coclass name. I take "pview" as a  parameter of a method, so
midl uses it throughout.

Best Wishes


Quote:
> IIRC I've seen similar problem reported when interfaces had parameters
> with the same names as coclasses except for case. You see, type library
> is case-insensitive, and it contains a symbol table listing all symbols
> without duplication. The format of the table does not allow keeping both
> pview and PView, so MIDL picks the spelling it first encounters, and
> uses it throughout.

> The workaround is either to be consistent in capitalization, or to avoid
> using conflicting identifiers.
> --
> With best wishes,
>     Igor Tandetnik

> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken



> > when i use midl to compile an "idl" file, i found the name of some
> coclass
> > or function has been changed to lowercase.
> > eg:
> > the source idl file:
> >  [
> >   uuid(FB3804D8-EFE7-425f-86B4-13356F606E97),
> >   version(1.0)
> >  ]
> >  coclass PView
> >  {
> >   interface IPView;
> >   [default, source] dispinterface _IPViewEvents;
> >   [default] interface IUnknown;
> >  };

> > [
> >  object,
> >  uuid(441C65FA-71B4-4e2d-8385-5DC08CACB591),
> >  version(1.0),
> >  pointer_default(unique)
> > ]
> > interface IPNewLine : IUnknown
> > {
> >  HRESULT _stdcall Finish ();
> > };

> > after been compiled, "coclass PView" has been changed to "coclass
> pview",
> > and function "Finish" has been changed to "finish".
> > Why?



Mon, 28 Feb 2005 10:37:23 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MIDL compiler question

2. dotnet MIDL compiler fails to generate .tlb for DownloadMgr.idl

3. midl compiler bug - msado15.idl

4. MIDL compiler appending letter 'A'

5. MIDL compiler integration in IDE with UNC-includes

6. MIDL compiler

7. MIDL 6.0 Compiler - Erratic Behavior

8. Troubles compiling IDL file using MIDL compiler.

9. Unable to find midl compiler on Windows_NT

10. FYI MIDL compiler upgrade

11. midl compiler bug?

12. MIDL compiler query

 

 
Powered by phpBB® Forum Software