Re: Use of GUID constants

2016-03-11 Thread Kagamin via Digitalmars-d-learn
Oh, it was https://github.com/D-Programming-Language/druntime/pull/1472

Re: Use of GUID constants

2016-03-11 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 18:35:31 UTC, KlausO wrote: So maybe they should be declared as "extern GUID ..." because they also seem to be defined in windows\lib\uuid.lib which comes with DMD. Declarations come from mingw and mingw doesn't have uuid.lib: https://issues.dlang.org/show_bug.cg

Re: Use of GUID constants

2016-03-10 Thread thedeemon via Digitalmars-d-learn
On Thursday, 10 March 2016 at 15:48:14 UTC, Mike Parker wrote: Personally I would just declare one immutable value in module scope and be done with it. It really just doesn't matter. Unless you're following some sort of style guide, personal preference rules the day. I don't know if Rainers has

Re: Use of GUID constants

2016-03-10 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 10 March 2016 at 14:52:16 UTC, KlausO wrote: For GUIDs you often have to take the address (e.g. for calls to QueryInterface), so I think phobos does not correctly implement this. Yes, that was my meaning. Is the above pair (const GUID and static member) the right way to declare

Re: Use of GUID constants

2016-03-10 Thread KlausO via Digitalmars-d-learn
For GUIDs you often have to take the address (e.g. for calls to QueryInterface), so I think phobos does not correctly implement this. In the meantime I took a look at the VisualD project which accesses the COM interfaces of visual studio. They solve the problem by using the following idiom (se

Re: Use of GUID constants

2016-03-10 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 10 March 2016 at 10:16:30 UTC, KlausO wrote: Ok, but what's the intention behind defining GUIDs as enums in the first place ? Probably just an implementation error, i.e. someone not fully appreciating how GUIDs are intended to be used. Is there a recommended way to declare/defin

Re: Use of GUID constants

2016-03-10 Thread KlausO via Digitalmars-d-learn
Ok, but what's the intention behind defining GUIDs as enums in the first place ? Why not defining them as const(GUID) and let the linker sort them out ? Is there a recommended way to declare/define constants (e.g. as enums or consts) ? In C (separate compilation) they are declared as "EXTERN_C

Re: Use of GUID constants

2016-03-09 Thread Ali Çehreli via Digitalmars-d-learn
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),

Use of GUID constants

2016-03-09 Thread KlausO via Digitalmars-d-learn
Dear list, I use DMD 2.070.0 I try to access COM Interfaces via the declarations in core.sys.windows.* I have some problems and maybe someone could give me a usage hint. Have a look at the following (relatively meaningless) sample program which demonstrates the problem. IMHO the problem is t