Click here to Skip to main content
15,907,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Function Traceback Pin
David Crow2-Dec-05 9:11
David Crow2-Dec-05 9:11 
GeneralRe: Function Traceback Pin
Suvendra2-Dec-05 9:29
Suvendra2-Dec-05 9:29 
GeneralRe: Function Traceback Pin
Maximilien2-Dec-05 9:19
Maximilien2-Dec-05 9:19 
GeneralRe: Function Traceback Pin
Suvendra2-Dec-05 9:38
Suvendra2-Dec-05 9:38 
GeneralRe: Function Traceback Pin
Jörgen Sigvardsson2-Dec-05 14:55
Jörgen Sigvardsson2-Dec-05 14:55 
QuestionIs it possible to store the images in one dll? Pin
G Haranadh2-Dec-05 8:01
G Haranadh2-Dec-05 8:01 
AnswerRe: Is it possible to store the images in one dll? Pin
Chris Losinger2-Dec-05 8:12
professionalChris Losinger2-Dec-05 8:12 
AnswerRe: Is it possible to store the images in one dll? Pin
Jörgen Sigvardsson2-Dec-05 8:13
Jörgen Sigvardsson2-Dec-05 8:13 
In your .rc file for the DLL project, add a line something like this for each image:
"MY_NAME" "IMAGES" "path\\to\\image.jpg".

Then load the DLL dynamically by using HMODULE hModule = LoadLibraryEx("path\\to\\dll", NULL, LOAD_LIBRARY_AS_DATAFILE); (Skip last parameter if you intend to execute code from it as well).

Then from your application call:
HRSRC hRes = FindResource(hModule, _T("MY_NAME"), _T("IMAGES"));
HGLOBAL hGlob = LoadResource(hModule, hRes);
DWORD dwResSize = SizeofResource(hModule, hRes);
void* pData = LockResource(hGlob);
By this point, pData is pointing to a byte array, which contains the data from the jpg-file. It's length is dwResSize.

I omitted all the error checking for brevity.

--
Pictures[^] from my Japan trip.
AnswerRe: Is it possible to store the images in one dll? Pin
Maximilien2-Dec-05 8:22
Maximilien2-Dec-05 8:22 
GeneralRe: Is it possible to store the images in one dll? Pin
G Haranadh2-Dec-05 8:27
G Haranadh2-Dec-05 8:27 
GeneralRe: Is it possible to store the images in one dll? Pin
ThatsAlok4-Dec-05 21:23
ThatsAlok4-Dec-05 21:23 
QuestionIcon/Bitmap + text on a button Pin
Shay Harel2-Dec-05 4:01
Shay Harel2-Dec-05 4:01 
AnswerRe: Icon/Bitmap + text on a button Pin
Chris Losinger2-Dec-05 4:41
professionalChris Losinger2-Dec-05 4:41 
GeneralRe: Icon/Bitmap + text on a button Pin
Jörgen Sigvardsson2-Dec-05 7:57
Jörgen Sigvardsson2-Dec-05 7:57 
GeneralRe: Icon/Bitmap + text on a button Pin
Chris Losinger2-Dec-05 7:59
professionalChris Losinger2-Dec-05 7:59 
GeneralRe: Icon/Bitmap + text on a button Pin
Jörgen Sigvardsson2-Dec-05 8:05
Jörgen Sigvardsson2-Dec-05 8:05 
AnswerRe: Icon/Bitmap + text on a button Pin
normanS4-Dec-05 19:46
normanS4-Dec-05 19:46 
QuestionTCP/IP stack for windows Pin
vikas amin2-Dec-05 2:56
vikas amin2-Dec-05 2:56 
AnswerRe: TCP/IP stack for windows Pin
rem-c2-Dec-05 4:20
rem-c2-Dec-05 4:20 
QuestionHow to Print a web page Pin
Ankush Mehta2-Dec-05 1:25
Ankush Mehta2-Dec-05 1:25 
AnswerRe: How to Print a web page Pin
peterchen2-Dec-05 2:01
peterchen2-Dec-05 2:01 
GeneralRe: How to Print a web page Pin
Ankush Mehta2-Dec-05 19:42
Ankush Mehta2-Dec-05 19:42 
QuestionRe: How to Print a web page Pin
David Crow2-Dec-05 4:22
David Crow2-Dec-05 4:22 
GeneralRe: How to Print a web page Pin
Ankush Mehta2-Dec-05 19:43
Ankush Mehta2-Dec-05 19:43 
GeneralRe: How to Print a web page Pin
David Crow3-Dec-05 15:01
David Crow3-Dec-05 15:01 

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.