confusing the C++ compiler with the linker here. They are different, and what you do in
C++ has no implicit effect on the linker. Go to the Linker, Inputs, and add your .lib
file to the additional libraries line.
Ehm I did... I put under Linker-General in Additional Library
Directories the path of that Debug directory where the .lib file is
created once compiled the DLL and I added under Linker-Input, in
Additional Dependencies that CACharts.lib.....
So I also created now a control variable (from the class add variable
wizard) for this and implemented the code:
CRect rect;
c_MyStaticControl.GetWindowRect(&rect);
ScreenToClient(&rect);
CCaChart c_MyControl;
c_MyControl.Create(rect, GetDlgItem
(c_MyStaticControl.GetDlgCtrlID()));
c_MyStaticControl.DestroyWindow();
but I get these linker errors:
1>test_chartDlg.obj : error LNK2019: unresolved external symbol
"public: virtual __thiscall CCaChart::~CCaChart(void)" (??
1CCaChart@@UAE@XZ) referenced in function "protected: virtual int
__thiscall Ctest_chartDlg::OnInitDialog(void)" (?
OnInitDialog@Ctest_chartDlg@@MAEHXZ)
1>test_chartDlg.obj : error LNK2019: unresolved external symbol
"public: virtual int __thiscall CCaChart::Create(class CRect const
&,class CWnd *)" (?Create@CCaChart@@UAEHABVCRect@@PAVCWnd@@@Z)
referenced in function "protected: virtual int __thiscall
Ctest_chartDlg::OnInitDialog(void)" (?
OnInitDialog@Ctest_chartDlg@@MAEHXZ)
1>test_chartDlg.obj : error LNK2019: unresolved external symbol
"public: __thiscall CCaChart::CCaChart(void)" (??0CCaChart@@QAE@XZ)
referenced in function "protected: virtual int __thiscall
Ctest_chartDlg::OnInitDialog(void)" (?
OnInitDialog@Ctest_chartDlg@@MAEHXZ)
So, suspecting a possible issue of my VS2008, I tried to create from
scratch with class wizards a simple stupid DLL without adding or
modifying anything and trying to create a Test file from Visual Studio
IDE itself and when it asks me to choose the DLL project to test, it
returns "Unknown address 0"... then I try to create a test project for
the example, adding the .lib and I get same linker error I pasted
before...
I thought you needed to export the symbols in the library.
class MYDLL_IO CCaChart: public ...