September 9th, 1999, 05:09 PM
I am currently taking all of a DLL's resource ID's and copying them into the client's resource.h to make my program work. If I don't have them there, then the program doesn't work. Is there another way?
|
Click to See Complete Forum and Search --> : Dll definitions September 9th, 1999, 05:09 PM I am currently taking all of a DLL's resource ID's and copying them into the client's resource.h to make my program work. If I don't have them there, then the program doesn't work. Is there another way? Peter A. Tolan September 9th, 1999, 09:58 PM Anon: Based on the following assumptions, that your dll has resources, (lets say a string table), and that your .exe has resources as well. Assuming that you are taking your DLL resources and merging them into your EXE resources, here is your solution. You are using the wrong instance handle when loading those resources. You should store the instance handle to your DLL in a global when your DLL is initialized. The proper way to do this is through an entry function DllMain() with the ulReason = DLL_PROCESS_ATTACH: If you need more information implementing this, leave me another message. The quick and dirty way to do this however (for testing purposes ) is to use something like this : LoadString ( GetModuleHandle ( "mydll.dll" ), IDS_TESTING, szText, sizeof ( szText ) ) ; ---- If this doesn't help, then explain what 'doesn't work' means. Ie, doesn't compile, doesn't display dialogs, etc.... Hope this helps. -Peter. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |