Click here to Skip to main content
15,845,785 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to attach a menu to a Window? Pin
toxcct27-Feb-06 23:35
toxcct27-Feb-06 23:35 
AnswerRe: How to attach a menu to a Window? Pin
Mahhouraaaaaa27-Feb-06 23:41
Mahhouraaaaaa27-Feb-06 23:41 
Questionhelp, about waveinopen on w2k Pin
black frank27-Feb-06 21:47
black frank27-Feb-06 21:47 
AnswerRe: help, about waveinopen on w2k Pin
black frank1-Mar-06 14:26
black frank1-Mar-06 14:26 
Questionhow to load bitmap image in a sub-window? Pin
adiilah27-Feb-06 21:30
adiilah27-Feb-06 21:30 
AnswerRe: how to load bitmap image in a sub-window? Pin
Naveen27-Feb-06 21:51
Naveen27-Feb-06 21:51 
AnswerRe: how to load bitmap image in a sub-window? Pin
Hamid_RT27-Feb-06 22:04
Hamid_RT27-Feb-06 22:04 
AnswerRe: how to load bitmap image in a sub-window? Pin
Stephen Hewitt27-Feb-06 22:23
Stephen Hewitt27-Feb-06 22:23 
Here's one way (I assume you want to load from a file):

1. Add a picture control to the dialog, be sure to set its type to "bitmap". Change to ID to something meaningful.

2. Using the ClassWizard add a member variable of type CStatic for the control, call it m_Picture.

3. Add the following to your class declaration:
HBITMAP m_hBM;

4. Add the following code to the dialog's OnInitDialog handler:
HBITMAP m_hBM = reinterpret_cast<HBITMAP>(
     LoadImage(
         NULL,
         _T("C:\\130x130.bmp"),
         IMAGE_BITMAP,
         0,
         0,
         LR_LOADFROMFILE
     )
);
m_Picture.SetBitmap(m_hBM);


5. Add the following in a WM_DESTROY handler:
DeleteObject(m_hBM);


Steve

Steve
QuestionVisual studio is not responding when trying to add file Pin
BiswaR27-Feb-06 21:20
BiswaR27-Feb-06 21:20 
AnswerRe: Visual studio is not responding when trying to add file Pin
mbue27-Feb-06 22:32
mbue27-Feb-06 22:32 
GeneralRe: Visual studio is not responding when trying to add file Pin
BiswaR27-Feb-06 23:21
BiswaR27-Feb-06 23:21 
Questionhow to forbid printing by local printer or network printer? Pin
szcococut27-Feb-06 20:53
szcococut27-Feb-06 20:53 
Questionhelp with CArray object Pin
SWDevil27-Feb-06 20:36
SWDevil27-Feb-06 20:36 
AnswerRe: help with CArray object Pin
The-Lion-King27-Feb-06 20:48
The-Lion-King27-Feb-06 20:48 
GeneralRe: help with CArray object Pin
SWDevil27-Feb-06 20:53
SWDevil27-Feb-06 20:53 
QuestionRe: help with CArray object Pin
David Crow28-Feb-06 4:02
David Crow28-Feb-06 4:02 
Questioninitialization of member variables Pin
Kranti125198427-Feb-06 19:28
Kranti125198427-Feb-06 19:28 
AnswerRe: initialization of member variables Pin
khan++27-Feb-06 20:21
khan++27-Feb-06 20:21 
AnswerRe: initialization of member variables Pin
Vinaya27-Feb-06 20:24
Vinaya27-Feb-06 20:24 
GeneralRe: initialization of member variables Pin
Kranti125198427-Feb-06 20:32
Kranti125198427-Feb-06 20:32 
GeneralRe: initialization of member variables Pin
Vinaya27-Feb-06 20:40
Vinaya27-Feb-06 20:40 
GeneralRe: initialization of member variables Pin
sunit527-Feb-06 20:53
sunit527-Feb-06 20:53 
GeneralRe: initialization of member variables Pin
Salad Bar27-Feb-06 20:43
Salad Bar27-Feb-06 20:43 
GeneralRe: initialization of member variables Pin
Kranti125198427-Feb-06 20:46
Kranti125198427-Feb-06 20:46 
QuestionThe Destructor can't cleanup the memory? Pin
signbit27-Feb-06 19:17
signbit27-Feb-06 19:17 

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.