D - interface function not implemented
- J C Calvarese (36/36) Feb 24 2004 I'm getting a weird error from trying to compile a class based on an
- Julio César Carrascal (2/6) Feb 25 2004 Why don't you use the "override" keyword?
- J Anderson (5/14) Feb 25 2004 Where is that listed in the documention? I've seen the override keyword...
- larry cowan (2/21) Feb 25 2004
- J Anderson (11/42) Feb 25 2004 The *override* attribute applies to virtual functions. It means that the...
- =?ISO-8859-1?Q?Sigbj=F8rn_Lund_Olsen?= (6/24) Feb 25 2004 I don't see entirely why you should have to explicitly 'override' an
- J C Calvarese (24/31) Feb 25 2004 Thanks for the suggestion. I hadn't tried that yet. Unfortunately, that
I'm getting a weird error from trying to compile a class based on an interface: main.d: class FakeStorage interface function IStorage.SetClass is not implemented Never mind the absense of a line number, I can find the IStorage interface ... extern(Windows) interface IStorage : IUnknown { //... HRESULT SetClass(REFCLSID clsid); } ... and I can find the FakeStorage class ... class FakeStorage : ComObject, IStorage { extern (Windows): HRESULT QueryInterface(IID* riid, void** ppv) { return E_NOTIMPL; } // ... HRESULT SetClass(REFCLSID clsid) { return S_OK; } // ... } It looks SetClass looks pretty implemented to me. REFCLSID should be compatible with REFCLSID. Does anyone have any hints what my problem might be? I've already tried abbreviating the offending code into a short example of the problem, but the error disappeared. I'll probably try again, but I thought someone might have a priceless hint that solves my problem. Thanks. -- Justin http://jcc_7.tripod.com/d/
Feb 24 2004
HRESULT SetClass(REFCLSID clsid) { return S_OK; }Why don't you use the "override" keyword? http://www.digitalmars.com/d/
Feb 25 2004
Julio César Carrascal wrote:Where is that listed in the documention? I've seen the override keyword before but never understood its use? -- -Anderson: http://badmama.com.au/~anderson/HRESULT SetClass(REFCLSID clsid) { return S_OK; }Why don't you use the "override" keyword? http://www.digitalmars.com/d/
Feb 25 2004
http://www.digitalmars.com/advancedsearch.html In article <c1icqr$1vlg$1 digitaldaemon.com>, J Anderson says...Julio César Carrascal wrote:Where is that listed in the documention? I've seen the override keyword before but never understood its use? -- -Anderson: http://badmama.com.au/~anderson/HRESULT SetClass(REFCLSID clsid) { return S_OK; }Why don't you use the "override" keyword? http://www.digitalmars.com/d/
Feb 25 2004
larry cowan wrote:http://www.digitalmars.com/advancedsearch.html In article <c1icqr$1vlg$1 digitaldaemon.com>, J Anderson says...The *override* attribute applies to virtual functions. It means that the function must override a function with the same name and parameters in a base class. The override attribute is useful for catching errors when a base class's member function gets its parameters changed, and all derived classes need to have their overriding functions updated. For anyone else who wants a direct link: http://www.digitalmars.com/d/attribute.html I don't think then that the override is nessary, it's for error checking. -- -Anderson: http://badmama.com.au/~anderson/Julio César Carrascal wrote:Where is that listed in the documention? I've seen the override keyword before but never understood its use? -- -Anderson: http://badmama.com.au/~anderson/HRESULT SetClass(REFCLSID clsid) { return S_OK; }Why don't you use the "override" keyword? http://www.digitalmars.com/d/
Feb 25 2004
J Anderson wrote:Julio César Carrascal wrote:I don't see entirely why you should have to explicitly 'override' an interface function. It should be rather obvious that if a class derives from an interface the function cannot possibly have been defined before. Cheers, Sigbjørn Lund OlsenWhere is that listed in the documention? I've seen the override keyword before but never understood its use?HRESULT SetClass(REFCLSID clsid) { return S_OK; }Why don't you use the "override" keyword? http://www.digitalmars.com/d/
Feb 25 2004
Julio César Carrascal wrote:Thanks for the suggestion. I hadn't tried that yet. Unfortunately, that just changes the error message: main.d(451): function SetClass function SetClass does not override any But then, I got it to work. I think I must have two REFCLSID's hanging around (with different definitions). So I re-created REFCLSID from scratch: struct jcc_GUID { align(1): DWORD Data1; WORD Data2; WORD Data3; BYTE Data4[8]; } alias jcc_GUID jcc_CLSID; alias jcc_CLSID* jcc_REFCLSID; I substituted jcc_REFCLSID for REFCLSID in both files and it worked! Woo-hoo! I'll have to look into the specifics later (so I don't get bit by this again), but hooray! The program compiles AND runs! -- Justin http://jcc_7.tripod.com/d/HRESULT SetClass(REFCLSID clsid) { return S_OK; }Why don't you use the "override" keyword? http://www.digitalmars.com/d/
Feb 25 2004