I created a default ATL project with MSVC 2010 with a simple default ATL dialog. Then I added the second project into solution, named MyControls, where I created ATL DHTML Control with a help of Wizard. Then I placed ATL DHTML Control to ATL dialog.
Now I would like to call some methods of that ATL DHTML Control in ATL dialog's OnInitDialog
function. In order to be able to make a call like:
CComPtr<IDHTMLControl> ptr;
HRESULT hr = GetDlgControl(IDC_ACTIVEX_CONTROL_DHTML
, IID_IDHTMLControl, (void**)&ptr);
I am including the file DHTMLControl.h from MyControls project. However, I get the following errors:
Note: It appears that I am linking MyControls.lib incorrectly, however, I added MyControls.lib to Linker->Input->Additonal Dependencies & specified ../$(Configuration) in the Linker->General->Additional Library Directories.
Anyone have an idea? Thanks!
The problem is related to how you link one project with the other. There is something missing here and since you don't show the code, it's a pure guess only.
On control project you have a type library which, when being built, also generates files MyControls_i.h
, MyControls_i.c
, MyControls_p.c
. I suppose that on the application project you included _i.h
file which declared symbols as externals, and you did not include the _i.c
file with symbols actually defined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With