Re: How to create an Interface to implement in VB6
Barzo wrote:
On 5 Giu, 12:13, Barzo <dba...@gmail.com> wrote:
[propget, id(11), helpstring("Get the IATDeviceDebugger object")]
HRESULT ModemDebugger([out, retval] _IATDeviceDebugger** );
[propputref, id(12), helpstring("Set the IATDeviceDebugger object")]
HRESULT ModemDebugger([in] _IATDeviceDebugger** );
Ok, my mistake was on IDs which are not equal!!
Now I have some problems on:
1. In my concrete class, I have to store a reference to the interface
_IATDeviceDebugger or to the coclass IATDeviceDebugger?
To the interface. In fact, you don't need to define the coclass at all,
it serves no purpose here. Also, it was unwise to give the coclass a
name that starts with I - such names are traditionally used for
interfaces, so the whole setup is pretty confusing.
2. How Can I implement these methods?
STDMETHODIMP CTETRAMoto::get_ATDeviceDebugger(_IATDeviceDebugger**
pIDebug)
{
};
STDMETHODIMP CTETRAMoto::get_ModemDebugger(
_IATDeviceDebugger** pIDebug)
{
return m_debugger.CopyTo(pIDebug)
};
assuming a member variable CComPtr<_IATDeviceDebugger> m_debugger.
STDMETHODIMP CTETRAMoto::put_ATDeviceDebugger(_IATDeviceDebugger**
pIDebug)
{
};
STDMETHODIMP CTETRAMoto::putref_ModemDebugger(
_IATDeviceDebugger* pIDebug)
{
m_debugger = pIDebug;
return S_OK;
};
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925