Click here to Skip to main content
15,920,828 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC Learning...Thanks a lot indeed Pin
SheheerZahid5-Jul-03 5:58
SheheerZahid5-Jul-03 5:58 
GeneralRe: MFC Learning...Thanks a lot indeed Pin
Ryan Binns5-Jul-03 13:59
Ryan Binns5-Jul-03 13:59 
Generaljunk character display in microsoft date time picker control Pin
Raghunandan S4-Jul-03 21:03
Raghunandan S4-Jul-03 21:03 
GeneralRe: junk character display in microsoft date time picker control Pin
Michael Dunn4-Jul-03 21:18
sitebuilderMichael Dunn4-Jul-03 21:18 
GeneralRe: junk character display in microsoft date time picker control Pin
Raghunandan S5-Jul-03 1:45
Raghunandan S5-Jul-03 1:45 
GeneralRe: junk character display in microsoft date time picker control Pin
Michael Dunn5-Jul-03 5:30
sitebuilderMichael Dunn5-Jul-03 5:30 
GeneralQues on Load Icon Pin
SatyaDY4-Jul-03 20:47
SatyaDY4-Jul-03 20:47 
GeneralRe: Ques on Load Icon Pin
Ryan Binns4-Jul-03 21:16
Ryan Binns4-Jul-03 21:16 
WorkDC is a memory device context - it's not associated with a display device. In order to be able to draw anything in it, it has to be associated with a bitmap for it to draw on. Using pDC works because the device context has somewhere to draw - the screen. To make this section of code work, you'll have to create a bitmap for it:
HICON hicon1;
CDC WordkDC;
HINSTANCE instance;
CBitmap bitmap; // new
CBitmap *pBitmap; // new

WorkDC.CreateCompatibleDC(pDC);
bitmap.CreateCompatibleBitmap(pDC, 1012, 668); // new
pBitmap = WorkDC.SelectObject(&bitmap); //new
instance=AfxGetInstanceHandle();
hicon1=::LoadIcon(instance,MAKEINTRESOURCE(IDI_ICON3));
WorkDC.DrawIcon(100,200,hicon1);
pDC->BitBlt(0,0,1012,668,&WorkDC,0,0,SRCCOPY);
WorkDC.SelectObject(pBitmap); // new
bitmap.DeleteObject(); // new
AfxMessageBox("In ondraw if condition");
Hope this helps,


Ryan

Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)

Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

GeneralRe: Ques on Load Icon Pin
SatyaDY6-Jul-03 17:44
SatyaDY6-Jul-03 17:44 
GeneralRe: Ques on Load Icon Pin
Ryan Binns6-Jul-03 18:11
Ryan Binns6-Jul-03 18:11 
Generaljunk character display in microsoft date time picker control Pin
Raghunandan S4-Jul-03 20:35
Raghunandan S4-Jul-03 20:35 
QuestionHow to enable (visiable) a CEdit before the dialog is displayed? Pin
Kevein4-Jul-03 17:58
Kevein4-Jul-03 17:58 
AnswerRe: How to enable (visiable) a CEdit before the dialog is displayed? Pin
Ryan Binns4-Jul-03 19:02
Ryan Binns4-Jul-03 19:02 
Generallinking with an mfc extension dll Pin
(Steven Hicks)n+14-Jul-03 13:46
(Steven Hicks)n+14-Jul-03 13:46 
GeneralRe: linking with an mfc extension dll Pin
valikac4-Jul-03 15:07
valikac4-Jul-03 15:07 
GeneralRe: linking with an mfc extension dll Pin
(Steven Hicks)n+14-Jul-03 17:19
(Steven Hicks)n+14-Jul-03 17:19 
GeneralRe: linking with an mfc extension dll Pin
(Steven Hicks)n+14-Jul-03 17:21
(Steven Hicks)n+14-Jul-03 17:21 
GeneralRe: linking with an mfc extension dll Pin
Kelly Herald7-Jul-03 6:06
Kelly Herald7-Jul-03 6:06 
GeneralExtracting records from file, but don't know how long records could be... Pin
IrishSonic4-Jul-03 13:26
IrishSonic4-Jul-03 13:26 
GeneralRe: Extracting records from file, but don't know how long records could be... Pin
David Crow4-Jul-03 13:40
David Crow4-Jul-03 13:40 
GeneralRe: Extracting records from file, but don't know how long records could be... Pin
IrishSonic4-Jul-03 13:57
IrishSonic4-Jul-03 13:57 
GeneralRe: Extracting records from file, but don't know how long records could be... Pin
David Crow7-Jul-03 4:19
David Crow7-Jul-03 4:19 
GeneralSize and Position Pin
Zak_4-Jul-03 12:33
Zak_4-Jul-03 12:33 
GeneralRe: Size and Position Pin
Michael Dunn4-Jul-03 13:09
sitebuilderMichael Dunn4-Jul-03 13:09 
Generaldealing with bi-directional association Pin
RK_20004-Jul-03 12:18
RK_20004-Jul-03 12:18 

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.