Sign in to follow this  
Guddi

Templates( C++)

Recommended Posts

Hi I am getting an error when I try to compile my code. I am using Visual C++ Express Edition. If anyone can help, I will really appreciate it. The code is: template <const CLSID* pclsid> class ATL_NO_VTABLE CComClassFactoryProtocolCLSID : public CComClassFactoryProtocolT<CComClassFactoryProtocolCLSID> { public: HRESULT GetTargetCLSID(CLSID& clsid); }; The error is on line two of the code above: error C3203: 'CComClassFactoryProtocolCLSID' : unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type

Share this post


Link to post
Share on other sites
afaik, all you need to do is change it to "<CComClassFactoryProtocolCLSID<pclsid> >" is your inherited class. This is because without the pclsid, it's not a real class, just a template of one. Also, don't forget the space between the last two angle brackets. It's an error if you don't put it (reads as operatior >>).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this