C
cipher
I have created a C++ MFC dialog based appliction with .NET 2003. I am
trying to use a functioning MFC extension dll. There is a header file for
this dll that defines a template class. .NET errors when trying to compile
this file. This dll and it's associated headers compile and function just
fine under VC++ 6. Help is appreciated. Thanks
Here is the gist of the header file in question:
template<class TYPE>
class AFX_EXT_CLASS CGisPtrArray : public CArray<TYPE *,TYPE *>
{
public:
CGisPtrArray();
~CGisPtrArray();
...
};
template<class TYPE>
CGisPtrArray<TYPE>::CGisPtrArray()
{
}
....
Here's the error from .NET:
GisArray.h(22) : error C2491: 'CGisPtrArray<TYPE>::__ctor' : definition of
dllimport function not allowed
GisArray.h(28) : error C2491: 'CGisPtrArray<TYPE>::~CGisPtrArray' :
definition of dllimport function not allowed
This error is duplicated for every method of the template class.
trying to use a functioning MFC extension dll. There is a header file for
this dll that defines a template class. .NET errors when trying to compile
this file. This dll and it's associated headers compile and function just
fine under VC++ 6. Help is appreciated. Thanks
Here is the gist of the header file in question:
template<class TYPE>
class AFX_EXT_CLASS CGisPtrArray : public CArray<TYPE *,TYPE *>
{
public:
CGisPtrArray();
~CGisPtrArray();
...
};
template<class TYPE>
CGisPtrArray<TYPE>::CGisPtrArray()
{
}
....
Here's the error from .NET:
GisArray.h(22) : error C2491: 'CGisPtrArray<TYPE>::__ctor' : definition of
dllimport function not allowed
GisArray.h(28) : error C2491: 'CGisPtrArray<TYPE>::~CGisPtrArray' :
definition of dllimport function not allowed
This error is duplicated for every method of the template class.