static library resource dialogs not working in linking applications
-
I have created a static library(Test.lib) and it has some resource dialogs and some classes say CMyDialog etc., . Created a sample application(Test.exe) which links with static library(Test.lib). Now I am creating a instance in my application and calling DoModal() did not work why? CMyDialog mydlg; mydlg.DoModal(); //No dialog shown
-
I have created a static library(Test.lib) and it has some resource dialogs and some classes say CMyDialog etc., . Created a sample application(Test.exe) which links with static library(Test.lib). Now I am creating a instance in my application and calling DoModal() did not work why? CMyDialog mydlg; mydlg.DoModal(); //No dialog shown
I think your CDialog resource may not available to the client text.exe. Since static library cannot contain the resource files, either you have add the resource file of the dialog in test.exe with the help of IDE or create the dialog dynamically in the static library, whichever you like.
Величие не Бога может быть недооценена.
-
I have created a static library(Test.lib) and it has some resource dialogs and some classes say CMyDialog etc., . Created a sample application(Test.exe) which links with static library(Test.lib). Now I am creating a instance in my application and calling DoModal() did not work why? CMyDialog mydlg; mydlg.DoModal(); //No dialog shown
-
I have created a static library(Test.lib) and it has some resource dialogs and some classes say CMyDialog etc., . Created a sample application(Test.exe) which links with static library(Test.lib). Now I am creating a instance in my application and calling DoModal() did not work why? CMyDialog mydlg; mydlg.DoModal(); //No dialog shown
You need to include the .rc from the static library in your .exe list of resource includes. e.g. Test.lib has TestLib.rc with all resources for static lib i.e. dialog template. Test.exe: - in VC++ goto resource view for project - right-click on TestExe.rc - select Resource Includes ... - add #include "TestLib.rc" to Compile-time directives Test.exe will now pull-in resources from Test.lib when built.
...cmk The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying. - John Carmack
-
You need to include the .rc from the static library in your .exe list of resource includes. e.g. Test.lib has TestLib.rc with all resources for static lib i.e. dialog template. Test.exe: - in VC++ goto resource view for project - right-click on TestExe.rc - select Resource Includes ... - add #include "TestLib.rc" to Compile-time directives Test.exe will now pull-in resources from Test.lib when built.
...cmk The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying. - John Carmack
-
Since the lib is used in many applications using .rc file in the static library is not correct way.
Well you cannot include .rc in static lib. cmk too said to include in exe. It is not possible so as we suggested you can either create the dialog dynamically or include .rc file in exe. These are the only options in front of you. :)
Величие не Бога может быть недооценена.
-
Well you cannot include .rc in static lib. cmk too said to include in exe. It is not possible so as we suggested you can either create the dialog dynamically or include .rc file in exe. These are the only options in front of you. :)
Величие не Бога может быть недооценена.
-
That fine. Its not easy to create dialog dynamically as we have lots of dialogs(with so many controls in it) in the .rc file.
Then you have include your .rc file to test.exe workspace. Unfortunately you cannot add .rc in static lib, it wont work :rolleyes:
Величие не Бога может быть недооценена.