![]() |
| | #1 |
| Registered User Join Date: Mar 2005 Location: Juneda
Posts: 229
| Calling IRichEditOle interface methods I'm totaly lost and confused, that's the case: the IRichEditOle interface is defined as follows Code: #define INTERFACE IRichEditOle
DECLARE_INTERFACE_(IRichEditOle, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(GetClientSite)(THIS_ LPOLECLIENTSITE*) PURE;
STDMETHOD_(LONG,GetObjectCount)(THIS) PURE;
STDMETHOD_(LONG,GetLinkCount)(THIS) PURE;
STDMETHOD(GetObject)(THIS_ LONG, REOBJECT*,DWORD) PURE;
STDMETHOD(InsertObject)(THIS_ REOBJECT*) PURE;
STDMETHOD(ConvertObject)(THIS_ LONG,REFCLSID,LPCSTR) PURE;
STDMETHOD(ActivateAs)(THIS_ REFCLSID,REFCLSID) PURE;
STDMETHOD(SetHostNames)(THIS_ LPCSTR,LPCSTR) PURE;
STDMETHOD(SetLinkAvailable)(THIS_ LONG,BOOL) PURE;
STDMETHOD(SetDvaspect)(THIS_ LONG,DWORD) PURE;
STDMETHOD(HandsOffStorage)(THIS_ LONG) PURE;
STDMETHOD(SaveCompleted)(THIS_ LONG,LPSTORAGE) PURE;
STDMETHOD(InPlaceDeactivate)(THIS) PURE;
STDMETHOD(ContextSensitiveHelp)(THIS_ BOOL) PURE;
STDMETHOD(GetClipboardData)(THIS_ CHARRANGE*,DWORD,LPDATAOBJECT*) PURE;
STDMETHOD(ImportDataObject)(THIS_ LPDATAOBJECT,CLIPFORMAT,HGLOBAL) PURE;
};
typedef IRichEditOle *LPRICHEDITOLE;
Code: LPRICHEDITOLE lp_richedit; SendMessage(rich_edit_handle,EM_GETOLEINTERFACE,0,(LPARAM)&lp_richedit) Code: lp_richedit->method(arguments); //to realease the interface handle I should use Release(), so: lp_richedit->Release(); Code: structure has no member named 'Release' I'm using DevCpp with MingW, and the code is C compiled as C. Thank's in advance Niara |
| Niara is offline | |
| | #2 |
| I have a hat!? Join Date: Apr 2008
Posts: 178
| You have to call them through the vtable and pass the object as the this pointer manually. Like this Code: IRichEditOle* ole = whatever; ole->lpVtbl->GetObjectCount(ole); |
| adeyblue is offline | |
| | #3 |
| Registered User Join Date: Mar 2005 Location: Juneda
Posts: 229
| Hi adeyblue, thank's for your time and help. That works as you said. I'm not sure about that, but I can remember (a little flash) that I have read here in cboard (or in a link from here) something about creating virtual functions (virtual function table) in plain C to work like C++ classes; I assume that is a sample of that. I'll have a deeper look at it. Thank's for the help Niara |
| Niara is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to get RSSI value, send to sensor, sensor receive package, repackage it? | techissue2008 | Networking/Device Communication | 1 | 03-04-2009 10:13 AM |
| Calling other objects methods inside a constructor | mynickmynick | C++ Programming | 5 | 09-17-2008 06:31 AM |
| Calling parent methods | Tonto | C++ Programming | 2 | 10-24-2006 07:00 PM |
| calling OpenGL methods from outside the main class | Hector | Game Programming | 2 | 06-22-2006 07:23 AM |
| calling methods | alcoholic | C++ Programming | 1 | 01-25-2002 11:23 AM |