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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VS.NET C++ error Overload memeber not found in ...

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
error C2511: 'HRESULT CDataAccessor::GetRecordSet(IUnknown ** )' : overloaded member function not found in 'CDataAccessor'

I didn't want to dump all the code
here is where the error is stopping
Code:
STDMETHODIMP CDataAccessor::GetRecordSet(IUnknown** NativeRecordSet)
{
   if (NativeRecordSet == NULL)
      return E_INVALIDARG;

   // Note that ADO provides the ADORecordsetConstructionPtr:
   ADORecordsetConstructionPtr spConsPtr;
   spConsPtr = m_spADORecordset;

   spConsPtr->get_Rowset(NativeRecordSet);

   return S_OK;
}

Can anyone help me
this is the sample C++ ATL ADO in VS.NET

DougP, MCP, A+
 
It looks like the definition doesn't match the function declaration in the header file.
 
I'm a total newbie to C++
how do I fix it?

DougP, MCP, A+
 
Show us the code in the header file that declares that function. It should probably look like this:
Code:
STDMETHODIMP GetRecordSet(IUnknown** NativeRecordSet);
 
Ok here is the header file
if I take out the remark I get another error as follows:

c:\Visual Studio .NET 2003\Vc7\atlmfc\include\atlcom.h(1759): error C2259: 'ATL::CComObject<Base>' : cannot instantiate abstract class
with
[
Base=CDataAccessor
]


Code:
// DataAccessor.h : Declaration of the CDataAccessor

#pragma once
#include "resource.h"       // main symbols

// The following pathname should match the path
// where msado15.dll resides on your system:
#import "C:\program files\common files\system\ado\msado15.dll" \
        no_namespace rename("EOF", "ADOEOF")

// IDataAccessor
[
	object,
	uuid("ACC3EA4E-D12E-4E13-8712-B5556A37E00B"),
	dual,	helpstring("IDataAccessor Interface"),
	pointer_default(unique)
]
__interface IDataAccessor : IDispatch
{
	[id(1), helpstring("method InitializeADO")] HRESULT InitializeADO(void);
	[id(2), helpstring("method GetRecordSet")] HRESULT GetRecordSet(void);
	[id(3), helpstring("method CloseADO")] HRESULT CloseADO(void);
};



// CDataAccessor

[
	coclass,
	threading("apartment"),
	vi_progid("NativeData.DataAccessor"),
	progid("NativeData.DataAccessor.1"),
	version(1.0),
	uuid("23B5CDA4-EF16-48FD-B4DE-03FD8601117E"),
	helpstring("DataAccessor Class")
]
class ATL_NO_VTABLE CDataAccessor : 
	public IDataAccessor
{
public:
	CDataAccessor()
	{
	}


	DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		return S_OK;
	}
	
	void FinalRelease() 
	{
	}
		CComPtr<IUnknown> m_pUnkMarshaler;

   // Pointers for ADO used in the application:
   _ConnectionPtr m_spADOConnection;
   _RecordsetPtr m_spADORecordset;

public:

	STDMETHOD(InitializeADO)(void);
	STDMETHOD(GetRecordSet)(void);
	//STDMETHODIMP GetRecordSet(IUnknown** NativeRecordSet);
	STDMETHOD(CloseADO)(void);
};



DougP, MCP, A+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top