Accessing COM Objects

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 12 21:52:49 PDT 2016


On Monday, 13 June 2016 at 02:08:22 UTC, Incognito wrote:

> What interface are you talking about? How can I cast to 
> something I don't have? I do not have a photoshop COM 
> interface. Are you saying that if CoCreateInstance worked that 
> I can then use the iid or pUnk to access the COM? Do I get the 
> members by trial and error? pUnk.width? Even if 
> CoCreateInstance passed, what do I do next?

You have to define the interface yourself, extending from 
IUnknown, implementing whatever functions are available on the 
COM interface you want. Here's an example for the ID3D11Device 
interface:

https://github.com/auroragraphics/directx/blob/master/d3d11.d#L1332



More information about the Digitalmars-d-learn mailing list