|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++.windows.32-bits - Resources in own libraries
Hello, perhaps anyone can help: I try to implement a dialog box in an own library. There is a resource file linked with this lib but when I use "CreateDialog" it returns windows error 1812. When I add the resource (I'm working with *.rc files) of the dialog to the resource of the main application, everything works fine. I wonder whether and how it's possible to use more than one resource file in an application? Greetings Heinz-Peter Dec 04 2003
Yes, you can add the resources to the .DLL, but you have to make sure that you can also load the resource from the .DLL and not from the .EXE. Per default the functions load resources from the main instance and not from the .DLL instance. So, make sure that the HINSTANCE parameter to CreateDialog is an instance to the .DLL and NOT to the .EXE using the .DLL. HTH Heinz-Peter Nüttgens wrote:Hello, perhaps anyone can help: I try to implement a dialog box in an own library. There is a resource file linked with this lib but when I use "CreateDialog" it returns windows error 1812. When I add the resource (I'm working with *.rc files) of the dialog to the resource of the main application, everything works fine. I wonder whether and how it's possible to use more than one resource file in an application? Greetings Heinz-Peter Dec 05 2003
Hello, thanks a lot for your suggestion, but I'm not using a DLL. Instead of this I use an old fashioned static library, which is bound to the rest of the application by the linker. Therefore there is only the instance of the WinMain of the application. I just tried to use a local resource in this library, which failed. Perhaps you know some kind of workaround or even a solution :-) Greetings Heinz-Peter "Jan Knepper" <jan smartsoft.us> schrieb im Newsbeitrag news:bqq5nn$1f8t$1 digitaldaemon.com...Yes, you can add the resources to the .DLL, but you have to make sure that you can also load the resource from the .DLL and not from the .EXE. Per default the functions load resources from the main instance and not from the .DLL instance. So, make sure that the HINSTANCE parameter to CreateDialog is an instance to the .DLL and NOT to the .EXE using the .DLL. HTH Heinz-Peter Nüttgens wrote:Hello, perhaps anyone can help: I try to implement a dialog box in an own library. There is a resource file linked with this lib but when I use "CreateDialog" it returns windows error 1812. When I add the resource (I'm working with *.rc files) of the dialog to the resource of the main application, everything works fine. I wonder whether and how it's possible to use more than one resource file in an application? Greetings Heinz-Peter Dec 06 2003
OK, if you are using a static .LIB your resource can not be included in the .LIB, but will have to be compiled into the .EXE. To to this just add a like #include "<library-resources>.rc" into the application .rc file. HTH Heinz-Peter Nüttgens wrote:Hello, thanks a lot for your suggestion, but I'm not using a DLL. Instead of this I use an old fashioned static library, which is bound to the rest of the application by the linker. Therefore there is only the instance of the WinMain of the application. I just tried to use a local resource in this library, which failed. Perhaps you know some kind of workaround or even a solution :-) Greetings Heinz-Peter "Jan Knepper" <jan smartsoft.us> schrieb im Newsbeitrag news:bqq5nn$1f8t$1 digitaldaemon.com...Yes, you can add the resources to the .DLL, but you have to make sure that you can also load the resource from the .DLL and not from the .EXE. Per default the functions load resources from the main instance and not from the .DLL instance. So, make sure that the HINSTANCE parameter to CreateDialog is an instance to the .DLL and NOT to the .EXE using the .DLL. HTH Heinz-Peter Nüttgens wrote:Hello, perhaps anyone can help: I try to implement a dialog box in an own library. There is a resource file linked with this lib but when I use "CreateDialog" it returns windows error 1812. When I add the resource (I'm working with *.rc files) of the dialog to the resource of the main application, everything works fine. I wonder whether and how it's possible to use more than one resource file in an application? Greetings Heinz-Peter Dec 06 2003
|