Use of GUID constants

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 9 14:20:14 PST 2016


On 03/09/2016 10:35 AM, KlausO wrote:

 >          IUnknown pUnk;
 >
 >          //
 >          // Does not compile:
 >          //
 >          //  Error: function
 > core.sys.windows.unknwn.IUnknown.QueryInterface(const(GUID)* riid,
 > void** pvObject) is not callable using argument types (const(GUID), 
void**)
 >          //
 >          hr = storage.QueryInterface(IID_IUnknown, cast(void**)&pUnk);

Without any experience with COM or (current) Windows programming, just 
by looking at that error message, the following may work:

     IID unknown = IID_IUnknown;
     // (Apparently, IID is an alias for const(GUID).)

     storage.QueryInterface(&unknown, /* ... */);

Ali



More information about the Digitalmars-d-learn mailing list