Templates( C++)
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
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 >>).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement