Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralConvert Calender ! Pin
Hadi Rezaee17-Dec-01 3:48
Hadi Rezaee17-Dec-01 3:48 
GeneralRe: Convert Calender ! Pin
Rashid Thadha17-Dec-01 4:12
Rashid Thadha17-Dec-01 4:12 
GeneralRe: Convert Calender ! Pin
Hadi Rezaee17-Dec-01 5:21
Hadi Rezaee17-Dec-01 5:21 
Questionhow to read ChooseColor() selection without exiting the dialog Pin
17-Dec-01 3:31
suss17-Dec-01 3:31 
Generalcontrol a downloaded activex control Pin
SAWilde17-Dec-01 2:40
SAWilde17-Dec-01 2:40 
GeneralRe: control a downloaded activex control Pin
Todd.Harvey18-Dec-01 9:07
Todd.Harvey18-Dec-01 9:07 
GeneralRe: control a downloaded activex control Pin
SAWilde19-Dec-01 0:01
SAWilde19-Dec-01 0:01 
QuestionHow to use Custom Resources Pin
Jon Hulatt17-Dec-01 1:41
Jon Hulatt17-Dec-01 1:41 
Hi.

My program needs a block of binary data to work. I do not want this binary data in a separate file because it is a) unchanging and b) i want minimal dependancies.

I've created a custom resource in resource editor and put my binary data in there.

I want to get a (BYTE *) pointer to this data at run time. The only method i've found of doing that up to now is this:

BYTE *p_SREData;
HGLOBAL hGlobal; HRSRC hRSrc;

hRSrc=FindResource(NULL, MAKEINTRESOURCE(IDR_DATA1),RT_RCDATA);
hGlobal=LoadResource(NULL, hRSrc);
p_SREData=(BYTE *) LockResource(hGlobal);


Whilst this works, surely there's a better, simpler way of getting the data?

And MSDN for LockResource states that the system frees allocated memory upon program termination, but you can free the memory manually when you no longer need it by calling one of the functions. But it's not obvious which function to use for a custom binary resource. Any ideas?



Sorry to dissapoint you all with my lack of a witty or poignant signature.
AnswerRe: How to use Custom Resources Pin
Ernest Laurentin17-Dec-01 4:36
Ernest Laurentin17-Dec-01 4:36 
GeneralHelp with multi-column ListBox Pin
Eugene Pustovoyt17-Dec-01 1:23
Eugene Pustovoyt17-Dec-01 1:23 
GeneralRe: Help with multi-column ListBox Pin
17-Dec-01 2:23
suss17-Dec-01 2:23 
GeneralRe: Help with multi-column ListBox Pin
Eugene Pustovoyt17-Dec-01 2:50
Eugene Pustovoyt17-Dec-01 2:50 
GeneralRe: Help with multi-column ListBox Pin
Ernest Laurentin17-Dec-01 4:39
Ernest Laurentin17-Dec-01 4:39 
GeneralRe: Help with multi-column ListBox Pin
Eugene Pustovoyt17-Dec-01 8:17
Eugene Pustovoyt17-Dec-01 8:17 
GeneralTrackPopupMenu Fails in Thread Pin
17-Dec-01 1:14
suss17-Dec-01 1:14 
GeneralRe: TrackPopupMenu Fails in Thread Pin
Ernest Laurentin17-Dec-01 4:58
Ernest Laurentin17-Dec-01 4:58 
GeneralRe: TrackPopupMenu Fails in Thread Pin
17-Dec-01 8:49
suss17-Dec-01 8:49 
GeneralCalculating sunrise and sunset times Pin
Prashanth Uppunda17-Dec-01 0:48
Prashanth Uppunda17-Dec-01 0:48 
GeneralRe: Calculating sunrise and sunset times Pin
Eugene Pustovoyt17-Dec-01 1:28
Eugene Pustovoyt17-Dec-01 1:28 
GeneralMultithread UDP Server using AsyncSocket Pin
dunkhong17-Dec-01 0:07
dunkhong17-Dec-01 0:07 
QuestionNIC information? Pin
16-Dec-01 22:59
suss16-Dec-01 22:59 
AnswerRe: NIC information? Pin
Joaquín M López Muñoz16-Dec-01 23:16
Joaquín M López Muñoz16-Dec-01 23:16 
Generalsecurity of .ocx Pin
marutis16-Dec-01 19:01
marutis16-Dec-01 19:01 
Generalstatic data member in MFC program Pin
Dave K Dosanjh16-Dec-01 16:28
Dave K Dosanjh16-Dec-01 16:28 
GeneralRe: static data member in MFC program Pin
Christian Graus16-Dec-01 16:47
protectorChristian Graus16-Dec-01 16:47 

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.