Thread: Making a DLL which includes an .rc file

  1. #1
    Registered User
    Join Date
    Feb 2004

    Exclamation Making a DLL which includes an .rc file

    First of all, I realize this has been asked before but they all concerned MFC so I'll just go ahead

    I'm creating a DLL for an application which includes an .rc file with dialogs, bitmaps, etc.
    My problem is that when I link statically to the DLL in another project the DLL isn't able to create the dialogs. It's like the resources aren't loaded into memory along with the DLL.
    If I both link AND include the .rc file in the new project everything works out just fine..

    How can I avoid having to manually include the .rc file (from the original project) and instead just use the DLL's interface functions in order to let it do it automatically?

    Thanks in advance!

  2. #2
    Registered User
    Join Date
    Jun 2005
    HINSTANCE Dllvar = NULL;
    Dllvar= AfxLoadLibrary(_T("dllname.dll"));
    Use the above code in ur dialogue initialization function(InitInstance()..)
    Place the "dllname.dll" and its header file in ur application folder.
    Include .lib file in project -> setting -> link -> object/library Modules.

    Where "dllname.dll" is ur resource dll name.

  3. #3
    Registered User
    Join Date
    Feb 2004
    Thanks for the reply.

    First of all I'm not using MFC but plain Win32 for this project.
    Second, I'm aiming to link the DLL statically, not dynamically at run-time.

    Do you have an alternative to your solution above which works for statically linked DLLs?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  3. Problems passing a file pointer to functions
    By smitchell in forum C Programming
    Replies: 4
    Last Post: 09-30-2008, 02:29 PM
  4. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM