Robert Shearman wrote:
-----Original Message----- From: Ove Kaaven [mailto:ovek@arcticnet.no] Sent: 01 January 2004 01:34 To: Robert Shearman Cc: Boaz Harrosh; wine-devel@winehq.org Subject: RE: unknwn.h: unknwn.idl
You can't use cpp_quote inside an interface definition.
True, but you can use cpp_quote to disable interface generation using cpp_quote("#if 0") ... cpp_quote("#endif"). This is how Microsoft do it with their unknwn.idl.
point taken I'll have a look. But that means two things: 1) At .h file we have Dead C++ code with no use, then another c++ code duplicating most of the other code. 2) The code is duplicated any way. What is the difference if it is duplicated in two different files (.h & .idl) or if it is duplicated inside the same file? In any way it will have to be maintained by hand. One in MIDL syntax and one in C++ syntax. ( with cpp_quote( .. ) around it ).
And all that for something that will never change ( :) ) I go for change the makefile.
By the way. some thing funny. In MS headers from VC6 they do not have that thing in the .idl file at all. And the .h file is hand crafted. In one of the SDKs (the one I have) they have above solution but the supplied Header is not the result of that idl file. It looks like: Here is the header but if you accidentally compile the idl it will give you some ugly brother that works too.
Apparently, MS didn't solve that problem, so widl hasn't either.
Microsoft caused the problem. What is the point of creating this automatic QueryInterface function? Is it that hard to pass in a matching IID with your interface pointer?
Well, Personally I like it. One less thing That I can screw up. Either it matches or it does not compile. I let the compiler do my job any day. Any way ATL will not compile with out it. And it cannot be fixed either. because a long chain of definitions relay at that chip of information been carried by the compiler down 5 layers of code. Look at it this way. One MS programmer hard codes COM in C the other one in ATL. Which one will finish first? Well the second one wrote IE. (I know bad example on purpose :) )