Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with IDispatchImpl

Status
Not open for further replies.

PerFnurt

Programmer
Feb 25, 2003
972
SE
Hiya,

I'm attempting to implement the Visual Studio Application model in a small app that I can test add-ins with. All-in-all it worked fine, but then I thought I should do it nicer, more ATL-ish, but being fairly new to ATL (its also an exercise/excuse to work with ATL) I can't get the implementing of the IDispatch straight.

With a class declaration as:
Code:
class ATL_NO_VTABLE CApplicationStub :
	public IApplication, // The iface I want to implement (it defines the various IDispatch methods as pure virtual)
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CApplicationStub, &CLSID_ApplicationStub>,
	public IDispatchImpl<IApplicationStub, &IID_IApplicationStub, &LIBID_ATLTestLib>
{
public:
  CApplicationStub()
  {
  }

  DECLARE_REGISTRY_RESOURCEID(IDR_APPLICATIONSTUB)
  DECLARE_PROTECT_FINAL_CONSTRUCT()
  BEGIN_COM_MAP(CApplicationStub)
    COM_INTERFACE_ENTRY(IApplicationStub)
    COM_INTERFACE_ENTRY(IDispatch)
  END_COM_MAP()
  // etc...

I keep getting &quot;cannot instantiate abstract class due to .... long __stdcall IApplication::GetTypeInfoCount(unsigned int *)&quot; and the other IDispatch methods as well.

I thought these methods are implemented by the IDispatchImpl template class. Well, obviously not since I get the error...

What am I stupidely missing?

Thanks

/Per

&quot;It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top