Print Page | Close Window

Help Needed: Explicit Toolkit DLL linking problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7279
Printed Date: 13 November 2025 at 2:07am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Help Needed: Explicit Toolkit DLL linking problem
Posted By: cjsnewbie
Subject: Help Needed: Explicit Toolkit DLL linking problem
Date Posted: 31 May 2007 at 9:50pm
Hi,
I'm using version 10.3.1. I was using implicit linking until now. But I want to link explicitly now onwards. I have defined "_XTPLIB_NOAUTOLINK" in preprocessor settings of project. Now I'm getting error as shown below:


-------------------------------
Error    23    error LNK2019: unresolved external symbol "__declspec(dllimport) public: enum XTPPopupState __thiscall CXTPPopupControl::GetPopupState(void)const " (__imp_?GetPopupState@CXTPPopupControl@@QBE?AW4XTPPopupState@@XZ) referenced in function "long __cdecl PopUpNotify(unsigned int,long)" (?PopUpNotify@@YAJIJ@Z)
--------------------------------


I looked at all exported symbols/functions/classes using dumpbin utility provided with Visual Studio. It shows this function is exported as:


-----------------------------------
6420 1913 003347DB ?GetPopupState@CXTPPopupControl@@QBE?AW4XTPPopupState@@XZ = @ILT+18390(?GetPopupState@CXTPPopupControl@@QBE?AW4XTPPopupState@@XZ)
-----------------------------------


Only difference is __imp_ prepended in first:

__imp_?GetPopupState@CXTPPopupControl@@QBE?AW4XTPPopupState@@XZ

as comapared to exported one:

?GetPopupState@CXTPPopupControl@@QBE?AW4XTPPopupState@@XZ

Looks like compiler is still looking for import library. How can I fix this problem?




Replies:
Posted By: Oleg
Date Posted: 01 June 2007 at 7:25am
Hi,
But do you add toolkit lib file to project lib dependence?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: cjsnewbie
Date Posted: 01 June 2007 at 1:48pm
Oleg,

Yes. I did. That fixed compilation error. But when I start my app, even before creating app object, it goes into toolkit dll. Since I'm explicitly linking ,shouldn't it wait until I called LoadLibrary function. Look at call stack. Looks like it's going in DllMain() of toolkit dll.




I guess, it is still not linking explicitly. If you guys have any sample code, I would really appreciate that.

One more thing: My understanding was that lib file is not required when you link dll explicitly.

See this: http://msdn2.microsoft.com/en-us/library/ms686944.aspx

Quote Because the program uses run-time dynamic linking, it is not necessary to link the module with an import library for the DLL.



Posted By: mgampi
Date Posted: 01 June 2007 at 4:33pm
Hi,
as far as I know is dynamic load of MFC extension DLLs a nightmare/impossible.
The codejock DLL exposes (MFC) C++ classes, not plain stdcall C API functions. The latter are candidates for dynamic load by calling LoadLibrary/GetProcAddress.
Explore the DLL using depends e.g. As you will see, classes and methods are somehow cryptic and definition of function pointer types for C++ class functions is almost impossible - not mentioning virtual functions... 


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net