Click here to Skip to main content
15,918,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to share a class between different projects in VC++? Pin
Mark Salsbery22-Jun-07 14:06
Mark Salsbery22-Jun-07 14:06 
GeneralRe: How to share a class between different projects in VC++? Pin
Skywalker200825-Jun-07 2:50
Skywalker200825-Jun-07 2:50 
QuestionHow to load a BMP from a resource dll Pin
sstainba22-Jun-07 10:07
sstainba22-Jun-07 10:07 
AnswerRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 10:25
Mark Salsbery22-Jun-07 10:25 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 11:22
sstainba22-Jun-07 11:22 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 12:26
Mark Salsbery22-Jun-07 12:26 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 12:32
sstainba22-Jun-07 12:32 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 12:46
Mark Salsbery22-Jun-07 12:46 
Laugh | :laugh: Ok, didn't you say you had no problem loading them and displaying them with LoadImage()?

What kind of handle are you trying to get?

You should have a valid HMODULE/HINSTANCE for the DLL to start with, or else it will never work.
You can get that by loading the DLL with LoadLibrary();

Then you need a valid name - if it's an integer ID then use the MAKEINTRESOURCE macro to convert the ID to a name "string".
HMODULE hResDLLModule = ::LoadLibrary(_T("c:\\path\myresdll.dll"));
if (hResDLLModule)
{
   // <code>IDB_BITMAP can be replaced with any integer that is a bitmap ID that exists in the DLL</code>
   HBITMAP hBitmap = (HBITMAP)::LoadImage(hResDLLModule, MAKEINTRESOURCE(IDB_BITMAP), ...);
   ...
   ::FreeLibrary(hResDLLModule);
}






"I'm the Dude. So that's what you call me. You know, that or, uh, His Dudeness, or uh, Duder, or El Duderino if you're not into the whole brevity thing." The Big Lebowski

GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 12:51
sstainba22-Jun-07 12:51 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 12:59
Mark Salsbery22-Jun-07 12:59 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 13:11
sstainba22-Jun-07 13:11 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 13:20
Mark Salsbery22-Jun-07 13:20 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 13:22
sstainba22-Jun-07 13:22 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 13:31
Mark Salsbery22-Jun-07 13:31 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 13:30
Mark Salsbery22-Jun-07 13:30 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 13:40
sstainba22-Jun-07 13:40 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 13:54
Mark Salsbery22-Jun-07 13:54 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 14:13
sstainba22-Jun-07 14:13 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 14:23
Mark Salsbery22-Jun-07 14:23 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery22-Jun-07 14:29
Mark Salsbery22-Jun-07 14:29 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba22-Jun-07 15:05
sstainba22-Jun-07 15:05 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery23-Jun-07 7:30
Mark Salsbery23-Jun-07 7:30 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery23-Jun-07 7:47
Mark Salsbery23-Jun-07 7:47 
GeneralRe: How to load a BMP from a resource dll Pin
sstainba23-Jun-07 11:27
sstainba23-Jun-07 11:27 
GeneralRe: How to load a BMP from a resource dll Pin
Mark Salsbery23-Jun-07 13:51
Mark Salsbery23-Jun-07 13:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.