CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Dll definitions

  1. #1
    Guest

    Dll definitions

    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?


  2. #2
    Join Date
    Sep 1999
    Location
    Ontario, Canada.
    Posts
    90

    Re: Dll definitions

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured