Click here to Skip to main content
15,888,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: minimise Lock and Unlock operation Pin
basementman1-Feb-05 6:34
basementman1-Feb-05 6:34 
GeneralRe: minimise Lock and Unlock operation Pin
David Crow1-Feb-05 10:13
David Crow1-Feb-05 10:13 
QuestionHow do I dynamically settitle of a page in a property sheet? Pin
akhildhanuka1-Feb-05 5:12
akhildhanuka1-Feb-05 5:12 
AnswerRe: How do I dynamically settitle of a page in a property sheet? Pin
Tom Wright1-Feb-05 6:08
Tom Wright1-Feb-05 6:08 
GeneralRe: How do I dynamically settitle of a page in a property sheet? Pin
karam_chand1-Feb-05 7:17
karam_chand1-Feb-05 7:17 
AnswerRe: How do I dynamically settitle of a page in a property sheet? Pin
karam_chand1-Feb-05 10:31
karam_chand1-Feb-05 10:31 
GeneralInserting an image into a view Pin
José Luis Sogorb1-Feb-05 5:08
José Luis Sogorb1-Feb-05 5:08 
GeneralRe: Inserting an image into a view Pin
Antti Keskinen1-Feb-05 7:55
Antti Keskinen1-Feb-05 7:55 
In the OnDraw handler of the view class, first create a HBITMAP struct. Then use LoadImage to load the bitmap image from a file into the struct. Then create a CBitmap object and attach it to the HBITMAP. Then use standard BitBlt techniques to blit the bitmap into the view.

Here's a code sample:
void CMyView::OnDraw(CDC* pDC)
{
   HBITMAP hbmpMyBitmap;
   hbmpMyBitmap = (HBITMAP) LoadImage( NULL, "C:\\Windows\\MyBitmap.bmp", 
                                       IMAGE_BITMAP, 0, 0, 
                                       LR_LOADFROMFILE );<DIV>

   CBitmap objBitmap;
   objBitmap.Attach( hbmpMyBitmap );<DIV>

   CDC tempDC;
   tempDC.CreateCompatibleDC( pDC );
   CBitmap* pOldBitmap = (CBitmap*) tempDC.SelectObject( &objBitmap );<DIV>

   pDC->BitBlt(x, y, width, height, &tempDC, 0, 0, SRCCOPY);<DIV>

   tempDC.SelectObject( pOldBitmap );
   
   return;
}
Something like this. Remember to replace file path, destination coordinates and bitmap width and height with the correct values.

Hope it helps,
Antti Keskinen






----------------------------------------------
"If we wrote a report stating we saw a jet fighter with a howitzer, who's going to believe us ?"

-- R.A.F. pilot quote on seeing a Me 262 armed with a 50mm Mauser cannon.
GeneralRe: Inserting an image into a view Pin
José Luis Sogorb1-Feb-05 23:03
José Luis Sogorb1-Feb-05 23:03 
Generalint nResponse = dlg.DoModal(); Visual C++ 6.0 Pin
Close Network1-Feb-05 3:44
Close Network1-Feb-05 3:44 
GeneralRe: int nResponse = dlg.DoModal(); Visual C++ 6.0 Pin
Michael Dunn1-Feb-05 3:58
sitebuilderMichael Dunn1-Feb-05 3:58 
GeneralRe: int nResponse = dlg.DoModal(); Visual C++ 6.0 Pin
Close Network1-Feb-05 4:29
Close Network1-Feb-05 4:29 
GeneralAVL Tree insertion algorithm Pin
Sarath C1-Feb-05 3:27
Sarath C1-Feb-05 3:27 
GeneralHooked MDIChild window ---&gt; problem Pin
Ro_land1-Feb-05 3:15
Ro_land1-Feb-05 3:15 
GeneralRe: Hooked MDIChild window ---&gt; problem Pin
Roger Allen1-Feb-05 6:10
Roger Allen1-Feb-05 6:10 
GeneralRe: Hooked MDIChild window ---&gt; problem Pin
Ro_land2-Feb-05 19:19
Ro_land2-Feb-05 19:19 
GeneralAVL Tree Pin
Sarath C1-Feb-05 3:05
Sarath C1-Feb-05 3:05 
Generalextracting part of a string Pin
si_691-Feb-05 2:52
si_691-Feb-05 2:52 
GeneralRe: extracting part of a string Pin
V.1-Feb-05 3:03
professionalV.1-Feb-05 3:03 
GeneralRe: extracting part of a string Pin
Sarath C1-Feb-05 3:26
Sarath C1-Feb-05 3:26 
GeneralRe: extracting part of a string Pin
bolivar1231-Feb-05 5:32
bolivar1231-Feb-05 5:32 
GeneralRe: extracting part of a string Pin
toxcct1-Feb-05 5:52
toxcct1-Feb-05 5:52 
QuestionCaveats when using SetParent ? Pin
Maximilien1-Feb-05 1:27
Maximilien1-Feb-05 1:27 
QuestionAny example Advise Sink in C++ ? Pin
im4help1-Feb-05 1:13
im4help1-Feb-05 1:13 
Generalvc++ Pin
nowshadmc1-Feb-05 1:01
nowshadmc1-Feb-05 1: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.