where I am trying to use an unmanaged header/lib file combo that exposes a
class for functionality... The trouble I run into seems trivial enough, but a
solution I've yet to find.
I get the following errors when trying to compile may application...
error LNK2001: unresolved external symbol "public: virtual class
ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> >
__thiscall MyClass::MyFunc(long,long,long)"
(?MyFunc@MyClass@@UAE?AV?$CStringT@DV?$StrTraitMFC _DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@JJJ@Z)
-and-
error LNK2001: unresolved external symbol "public: virtual long __thiscall
MyClass::MyFunc2(long,class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > &)"
(?MyFunc2@MyClass@@UAEJJAAV?$CStringT@DV?$StrTrait MFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z)
I've read every google result for a search on CStringT, as well as read and
tried the solution presented by 309801 PRB: Linking Errors When You Import
CString-Derived Classes (Even though 2003 was supposed to fixed this error).
I've even tried including cstringt.h as well as atlstr.h, and some combos
thereof, still no luck.
Anyway, seems only functions declared with an [in, out] CString generate the
errors. I.E. a function prototype: FunctionName(CString ¶m). No other
function prototypes generate an error.
Is it possible to use this type of class function call in Managed C++ from a
native C++ dll? If so, how?
~Tony