I have an interface (ITask) that implemented by a VB6 COM object. I have a C++ COM object that uses the interface, and it generally works fine.
However, when I run the VB6 debugger to debug the VB6 COM object, my C++ object is all of a sudden getting E_NOINTERFACE returned when it calls QueryInterface on the VB6 object for the ITask interface.
Interface definition:
[
object,
uuid(XXXX),
pointer_default(unique),
oleautomation
]
interface ITask : IUnknown
{
[id(1)] HRESULT CreateTask([in, string] BSTR taskName);
}
C++ code:
hResult = pDisp->QueryInterface(IID_ITask, (void **) &m_pTaskApp);
(pDisp
is an IDispatch *
to the VB6 COM object that I obtained through a call to a different component that manages object lifetimes)
A call to QueryInterface for IID_IDispatch succeeds when the VB6 COM object is running the debugger.
Any ideas?
EDIT - Add the VB6 code:
Implements ITask
Private Sub ITask_CreateTask(ByVal taskName as String)
' do stuff
End Sub