Re: another COM-Question: how to inject a type-lib into a dll?



Axel Bock <axel.bock.news@xxxxxxxxxxxxxx> wrote:
> Basically I created a COM server project, and defined a class with a
> method:
>
> STDMETHODIMP
> MyClass::MyMethod(myEnumType en, VARIANT_BOOL somethingElse)
> { ... }
>
> When compiling the MIDL compiler said:
> error MIDL2011 : unresolved type declaration : ....
>
> That is the error I am referring to. Cause it might be that I will be
> porting a project with **many** custom typedef'ed enums I really don't
> want to write a MIDL definition for each of them manually.

Can't you copy-and-paste already-written definitions from your header
files into your IDL file? Also, you can use #include in the IDL file in
the usual way. If you have a header with these enums and nothing else,
you should be able to just include it.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: How do I supress MIDL warnings?
    ... so I don't want to mess with the code. ... I don't want to change the warning level, ... Since the MIDL compiler runs before any other files are compiled, ... You can put "midl_pragma warning" directive at the top of your IDL file. ...
    (microsoft.public.vc.language)
  • Re: IDL namespaces?
    ... MIDL compiler itself only knows C. ... cpp_quote("namespace MyLib {") ...
    (microsoft.public.vc.atl)
  • Re: C++ COM STA model
    ... proxy/stub DLL for IDispatch already installed and registered. ... IDL file and using MIDL compiler to generate a typelib and register it into ... I mean manually use MIDL compiler to compile IDL file to generate stub/proxy ...
    (microsoft.public.vc.language)
  • Re: C++ COM STA model
    ... proxy/stub DLL for IDispatch already installed and registered. ... register it into Windows Registry, even if it is not dual interface. ... writing an IDL file? ... I mean manually use MIDL compiler to compile IDL file to generate ...
    (microsoft.public.vc.language)

Loading