unknwn.h: unknwn.idl

Robert Shearman R.J.Shearman at warwick.ac.uk
Wed Dec 31 10:48:54 CST 2003


> -----Original Message-----
> From: wine-devel-admin at winehq.org [mailto:wine-devel-admin at winehq.org]On
> Behalf Of Boaz Harrosh
> Sent: 31 December 2003 14:56
> To: wine-devel mailing list
> Subject: unknwn.h: unknwn.idl
>
> 2 Questions
>
> 1) if I do "make depend" than edit unknwn.idl (or any other idl) than do
> "make" should a new unknwn.h be compiled?
> Well it does not. If I "cd include" and "make" than nothing is done
> either. only if I do "make unknwn.h" it will compile.

"make idl" will make all of the idl files. I'm not sure why it is done this
way, but those files are only updated once in a blue moon anyway.

>
> 2) In order for ATL to compile I need below code in my unknwn.h file. I
> could not fined a way to do it with WIDL.

Use cpp_quote (grep for examples in other idl files).

> I have looked in Microsoft (vc6) header/idl and it looks they had the
> same problem. And below code was added by hand.
> Now if the answer to Q1 is "No not done automatically" than I guess I
> can submit a patch for unknwn.h only. could I also submit a patch to
> include/Makefile.in to remove unknwn.idl from the list of idl files so
> it will not accidentally over-write unknwn.h?

No. You should use cpp_quote. It may be necessary to disable stuff in the .h
generated file which you can do with:
cpp_quote("#if 0")
...
cpp_quote("#endif")

> I have tried below simple idl code but it will go to all the wrong places

Where does it go? Maybe you need to also protect that bit of code with #if
defined _cplusplus?

> <bad unknwn.idl code>
>     ...
>
> interface IUnknown
> {
>   typedef [unique] IUnknown *LPUNKNOWN;
>
>   HRESULT QueryInterface(
>     [in] REFIID riid,
>     [out, iid_is(riid)] void **ppvObject);
>   ULONG AddRef();
>   ULONG Release();
> cpp_quote("#if !defined(WINE_NO_UUIDOF)")
> cpp_quote("template <class Q>")
> cpp_quote("HRESULT STDMETHODCALLTYPE QueryInterface(Q** pp)")
> cpp_quote("{")
> cpp_quote("    return QueryInterface(__uuidof(Q), (void**)pp);")
> cpp_quote("}")
> cpp_quote("#endif")
>
> }
>
> cpp_quote("#if !defined(WINE_NO_UUIDOF)")
> cpp_quote("} /*extern C++*/")
> cpp_quote("#endif")
>
>     ...
> </bad unknwn.idl code>





More information about the wine-devel mailing list