New customer. We have a rather large application where we are trying to replace the existing framework with that from ToolKitPro. Unfortunately, early in the process we have hit a snag.
The application has multiple DLLs, ToolKitPro was built as a separate DLL using the provided wizard. From our DLL, we have instantiated a XTP class. We can apparently call any member function as long as it does not require a CString as a parameter. When we call a member requiring a CString, we get the following type of link error.
DCVCore error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall CXTPStatusBar::SetPaneText(int,class ATL::CStringT<unsigned short,class StrTraitMFC_DLL<unsigned short,class ATL::ChTraitsCRT<unsigned short> > > const &,int)" (__imp_?SetPaneText@CXTPStatusBar@@QAEHHABV?$CStringT@GV?$StrTraitMFC_DLL@GV?$ChTraitsCRT@G@ATL@@@@@ATL@@H@Z) referenced in function "public: void __thiscall CMainFrame::SetIndicatorText(int,unsigned short const *)" ( mailto:?SetIndicatorText@CMainFrame@@QAEXHPBG@Z - ?SetIndicatorText@CMainFrame@@QAEXHPBG@Z )
This appears to be a name-mangling conflict.
In export file from Toolkit DLL
?SetPaneText@CXTPStatusBar@@QAEHHABV?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@H@Z
Link error from our DLL
?SetPaneText@CXTPStatusBar@@QAEHHABV?$CStringT@GV?$StrTraitMFC_DLL@GV?$ChTraitsCRT@G@ATL@@@@@ATL@@H@Z)
You will notice that the CString parameter is not mangled the same way.
Our DLL is compiled for Unicode, just as we (think) selected for the ToolKit DLL.
Anyway, does anyone have a guess as to what will resolve our problem. I'm going to guess it is a compiler or linker option conflict between the DLLs. We'll be looking into that next.
SEK
|