Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Help Needed: Explicit Toolkit DLL linking problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Help Needed: Explicit Toolkit DLL linking problem

 Post Reply Post Reply
Author
Message
cjsnewbie View Drop Down
Groupie
Groupie


Joined: 24 October 2006
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote cjsnewbie Quote  Post ReplyReply Direct Link To This Post Topic: Help Needed: Explicit Toolkit DLL linking problem
    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?

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
cjsnewbie View Drop Down
Groupie
Groupie


Joined: 24 October 2006
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote cjsnewbie Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.