Hi Fabian,
On 10/11/2018 23:57, Fabian Maurer wrote:
Since the com simplification with the macros is probably not feasible, here an approach that reuses an old idea - using widl to generate a classfactory.
Since the code that you generate seems very similar to what you sent in header, comments that I sent you to that patch apply here as well.
Other than that, you introduce wine/debug.h dependency in widl generated sources, which makes it usable only for Wine internals. Introducing something only for Wine internals in widl could be fine if justified, but I'm not sure that's the case.
This implementation does not allow DLLs to mix custom class factories and generated ones in the same DLL. Some class factories need for example additional interfaces. Those will have to be implemented from scratch, which is fine. But if other class factories from the same DLL could use generic implementation, they can't because of how DllGetClassObject is generated.
On the first look I liked the idea of using widl for class factories. But after having closer look, I'm no longer convinced it's the right tool. Class factories are really simple things, and having widl extension might be more complexity than it's worth. A simple header with default implementation and a single macro just for vtbl (not for the actual code) is all that's really needed.
Thanks, Jacek