By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,194 Members | 821 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,194 IT Pros & Developers. It's quick & easy.

COM out-of-proc error

P: 18
Hi all,
I'm not able to compile out-of-proc component. The error I'm getting is

Error 1 error C2259: 'CFile' : cannot instantiate abstract class


I have given implementation for all of the methods in CFile class, which is derived form interface IFile. The createInstance method of CFactory derived from IClassFactory is

HRESULT CFactory::CreateInstance(IUnknown *pUnknownOuter, REFIID riid, void **ppv)
{
if(pUnknownOuter != NULL)
return CLASS_E_NOAGGREGATION;

CFile *pF = new CFile;
cout << "Component: CFactory::CreateInstance() " << pF << endl;

if(pF == NULL)
return E_OUTOFMEMORY;

HRESULT hr = pF->QueryInterface(riid, ppv);
pF->Release();
return hr;
}

Im not able to compile at the line CFile *pF = new CFile;

Thanks,
SC
Mar 18 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.