Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtResizableDialog and LINK errors. Collapse All
Subject Author Date
Jeremy Ruth Jan 4, 2007 - 11:51 AM

I have an MFC DLL project that exports some classes and some dialogs. I am attempting to change the dialogs to use CExtResizableDialog. I changed just one of the dialogs and replaced a CListCtrl with CExtGridWnd. All compiles fine, but I am getting a bunch of link errors:

Linking...
Creating library Debug/gf1CS.lib and object Debug/gf1CS.exp
CSDefineDlg.obj : error LNK2001: unresolved external symbol "protected: virtual int __thiscall CExtPopupMenuWnd::_TrackPopupMenu(unsigned long,int,int,struct tagRECT const *,void *,void (__stdcall*)(void *,class CDC &,class CWnd const &,class CRect
const &,int),bool)" (?_TrackPopupMenu@CExtPopupMenuWnd@@MAEHKHHPBUtagRECT@@PAXP6GX1AAVCDC@@ABVCWnd@@ABVCRect@@H@Z_N@Z)
CSSpec.obj : error LNK2001: unresolved external symbol "protected: virtual int __thiscall CExtPopupMenuWnd::_TrackPopupMenu(unsigned long,int,int,struct tagRECT const *,void *,void (__stdcall*)(void *,class CDC &,class CWnd const &,class CRect const
&,int),bool)" (?_TrackPopupMenu@CExtPopupMenuWnd@@MAEHKHHPBUtagRECT@@PAXP6GX1AAVCDC@@ABVCWnd@@ABVCRect@@H@Z_N@Z)
StdAfx.obj : error LNK2001: unresolved external symbol "protected: virtual int __thiscall CExtPopupMenuWnd::_TrackPopupMenu(unsigned long,int,int,struct tagRECT const *,void *,void (__stdcall*)(void *,class CDC &,class CWnd const &,class CRect const
&,int),bool)" (?_TrackPopupMenu@CExtPopupMenuWnd@@MAEHKHHPBUtagRECT@@PAXP6GX1AAVCDC@@ABVCWnd@@ABVCRect@@H@Z_N@Z)
CSDefineDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CExtPopupMenuWnd::TrackPopupMenu(unsigned long,int,int,struct tagRECT const *,void *,void (__stdcall*)(void *,class CDC &,class CWnd const &,class CRect cons
t &,int),unsigned int *,bool)" (?TrackPopupMenu@CExtPopupMenuWnd@@UAEHKHHPBUtagRECT@@PAXP6GX1AAVCDC@@ABVCWnd@@ABVCRect@@H@ZPAI_N@Z)
CSSpec.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CExtPopupMenuWnd::TrackPopupMenu(unsigned long,int,int,struct tagRECT const *,void *,void (__stdcall*)(void *,class CDC &,class CWnd const &,class CRect const &,i
nt),unsigned int *,bool)" (?TrackPopupMenu@CExtPopupMenuWnd@@UAEHKHHPBUtagRECT@@PAXP6GX1AAVCDC@@ABVCWnd@@ABVCRect@@H@ZPAI_N@Z)
StdAfx.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CExtPopupMenuWnd::TrackPopupMenu(unsigned long,int,int,struct tagRECT const *,void *,void (__stdcall*)(void *,class CDC &,class CWnd const &,class CRect const &,i
nt),unsigned int *,bool)" (?TrackPopupMenu@CExtPopupMenuWnd@@UAEHKHHPBUtagRECT@@PAXP6GX1AAVCDC@@ABVCWnd@@ABVCRect@@H@ZPAI_N@Z)
CSDefineDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __stdcall CExtPopupMenuWnd::CancelMenuTracking(void)" (__imp_?CancelMenuTracking@CExtPopupMenuWnd@@SGXXZ)
CSSpec.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __stdcall CExtPopupMenuWnd::CancelMenuTracking(void)" (__imp_?CancelMenuTracking@CExtPopupMenuWnd@@SGXXZ)
StdAfx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __stdcall CExtPopupMenuWnd::CancelMenuTracking(void)" (__imp_?CancelMenuTracking@CExtPopupMenuWnd@@SGXXZ)
CSDefineDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static int __stdcall CExtPopupMenuWnd::IsMenuTracking(void)" (__imp_?IsMenuTracking@CExtPopupMenuWnd@@SGHXZ)
CSSpec.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static int __stdcall CExtPopupMenuWnd::IsMenuTracking(void)" (__imp_?IsMenuTracking@CExtPopupMenuWnd@@SGHXZ)
StdAfx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static int __stdcall CExtPopupMenuWnd::IsMenuTracking(void)" (__imp_?IsMenuTracking@CExtPopupMenuWnd@@SGHXZ)
Debug/gf1CS.dll : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

gf1CS.dll - 13 error(s), 0 warning(s)


I am linking with ProfUIS263ud.lib (which is visible to the build). It seems the only issues center around CExtPopupMenuWnd, which I do not use explicitly anywhere in my project.

Johnny Booth Feb 26, 2007 - 10:47 AM

I have seen this problem too and found the problem to be that my application .cpp files were setup to comple with _stdcall calling convention. The Prof-UIS dlls are all setup to use _cdecl calling convention. What I ended up doing is rebuilding the ProfUISDLLs with code generation set to _stdcall. I couldn’t change my .cpp modules to use _cdecl since several other DLLs used in my project use _stdcall for all their functions.

The downside to custom rebuilding the DLLs with a different configuration as the provided defaults, is that it is possible that another softwre vendor could build the ProfUIS DLLs with the default settings and replace your "custom" ProfUIS DLLs thus breaking your software. Alternatively, your "custom" ProfUIS dlls could break somebody else’s software if they are using the "standard" ProfUIS DLLs. As a precaution for my company’s software, we probably will have our installer put the "custom" ProfUIS DLL into the same folder as our EXE files.

Perhaps it would be useful to many users of ProfUIS if we had a "standard" build configuration that builds the DLLs with _stdcall calling convention.

Technical Support Feb 26, 2007 - 12:42 PM

The number of build configurations provided by Prof-UIS is quite large and this sometimes confuses un-experienced users. We could add even more configurations by manipulating with calling conventions and structure member alignments, but we do not see any strong reason to do this. Your calling convention requirement is very specific for your project. You can simply rename Prof-UIS DLL module to avoid any potential conflicts in the future.

Technical Support Jan 5, 2007 - 10:34 AM

Your application and the library should use the same settings for the compiler option Treat w_char as Built-In type when Unicode is used. Please check this. The article Compatibility with Built-In Unicode Character Type may be helpful with this.

Jeremy Ruth Jan 5, 2007 - 12:49 PM

Thanks for the response. I am using VC++ 6.0 so I don’t believe that option exists.

What is the difference between the .lib file that gets generated when building the LIB project and the .lib file that gets generated when building the DLL project? The LIB project (after I changed to use shared MFC) produces a 63 MB file and the DLL project produces a 5 MB file.

I successfully built the ProfUIS_Controls sample which uses CExtResizableDialog, so I am stumped. Any other ideas?

Thanks,
Jeremy

Technical Support Jan 6, 2007 - 7:15 AM

The LIB project allows you to produce lib files which you can statically use in your executable applications or in your MFC extension dlls. Your application statically compiled with Prof-UIS has the same functionality as when it uses Prof-UIS via a separate dll file. And such a lib file is always greater in size than the corresponding dll file. The second lib file in question is used for letting your executable application know about the dll that your exe will use at run time. The available options are described in this article.

If you want to use Prof-UIS in your extension dll project (not in a regular dll project) and to use both Prof-UIS and MFC as dlls, then you should first compile the ProfUISDLL project. You did this and you used the Unicode Debug configuration. So far, so good. The errors relate to CExtPopupMenuWnd and although you are not using it directly, it is used indirectly from CExtGridWnd. Please try to completely rebuild the project again. Try to exclude CExtGridWnd for the time being and let us know if the errors persists. You can also send us a project that reproduces the problem. There must be something simple.