Click here to Skip to main content
15,889,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to attach a menu to a Window? Pin
toxcct27-Feb-06 22:35
toxcct27-Feb-06 22:35 
AnswerRe: How to attach a menu to a Window? Pin
Mahhouraaaaaa27-Feb-06 22:41
Mahhouraaaaaa27-Feb-06 22:41 
Questionhelp, about waveinopen on w2k Pin
black frank27-Feb-06 20:47
black frank27-Feb-06 20:47 
AnswerRe: help, about waveinopen on w2k Pin
black frank1-Mar-06 13:26
black frank1-Mar-06 13:26 
Questionhow to load bitmap image in a sub-window? Pin
adiilah27-Feb-06 20:30
adiilah27-Feb-06 20:30 
AnswerRe: how to load bitmap image in a sub-window? Pin
Naveen27-Feb-06 20:51
Naveen27-Feb-06 20:51 
AnswerRe: how to load bitmap image in a sub-window? Pin
Hamid_RT27-Feb-06 21:04
Hamid_RT27-Feb-06 21:04 
AnswerRe: how to load bitmap image in a sub-window? Pin
Stephen Hewitt27-Feb-06 21:23
Stephen Hewitt27-Feb-06 21: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 20:20
BiswaR27-Feb-06 20:20 
AnswerRe: Visual studio is not responding when trying to add file Pin
mbue27-Feb-06 21:32
mbue27-Feb-06 21:32 
GeneralRe: Visual studio is not responding when trying to add file Pin
BiswaR27-Feb-06 22:21
BiswaR27-Feb-06 22:21 
Questionhow to forbid printing by local printer or network printer? Pin
szcococut27-Feb-06 19:53
szcococut27-Feb-06 19:53 
Questionhelp with CArray object Pin
SWDevil27-Feb-06 19:36
SWDevil27-Feb-06 19:36 
AnswerRe: help with CArray object Pin
The-Lion-King27-Feb-06 19:48
The-Lion-King27-Feb-06 19:48 
GeneralRe: help with CArray object Pin
SWDevil27-Feb-06 19:53
SWDevil27-Feb-06 19:53 
QuestionRe: help with CArray object Pin
David Crow28-Feb-06 3:02
David Crow28-Feb-06 3:02 
Questioninitialization of member variables Pin
Kranti125198427-Feb-06 18:28
Kranti125198427-Feb-06 18:28 
AnswerRe: initialization of member variables Pin
khan++27-Feb-06 19:21
khan++27-Feb-06 19:21 
AnswerRe: initialization of member variables Pin
Vinaya27-Feb-06 19:24
Vinaya27-Feb-06 19:24 
GeneralRe: initialization of member variables Pin
Kranti125198427-Feb-06 19:32
Kranti125198427-Feb-06 19:32 
GeneralRe: initialization of member variables Pin
Vinaya27-Feb-06 19:40
Vinaya27-Feb-06 19:40 
GeneralRe: initialization of member variables Pin
sunit527-Feb-06 19:53
sunit527-Feb-06 19:53 
GeneralRe: initialization of member variables Pin
Salad Bar27-Feb-06 19:43
Salad Bar27-Feb-06 19:43 
GeneralRe: initialization of member variables Pin
Kranti125198427-Feb-06 19:46
Kranti125198427-Feb-06 19:46 
QuestionThe Destructor can't cleanup the memory? Pin
signbit27-Feb-06 18:17
signbit27-Feb-06 18: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.