Click here to Skip to main content
15,896,207 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to drag a document to a listctrl from desktop for example (mfc) Pin
johnfafa12-Jul-09 22:02
johnfafa12-Jul-09 22:02 
GeneralRe: how to drag a document to a listctrl from desktop for example (mfc) Pin
Stuart Dootson12-Jul-09 22:08
professionalStuart Dootson12-Jul-09 22:08 
GeneralRe: how to drag a document to a listctrl from desktop for example (mfc) Pin
Stuart Dootson12-Jul-09 23:38
professionalStuart Dootson12-Jul-09 23:38 
Questionthe parent of exe files in windows Pin
zon_cpp11-Jul-09 22:33
zon_cpp11-Jul-09 22:33 
AnswerRe: the parent of exe files in windows Pin
Stuart Dootson11-Jul-09 23:48
professionalStuart Dootson11-Jul-09 23:48 
GeneralRe: the parent of exe files in windows Pin
zon_cpp12-Jul-09 0:04
zon_cpp12-Jul-09 0:04 
GeneralRe: the parent of exe files in windows Pin
Stuart Dootson12-Jul-09 0:24
professionalStuart Dootson12-Jul-09 0:24 
QuestionA CLASS TO CONTROL SOME BITMAPS [modified] Pin
Dr.FIA11-Jul-09 19:51
Dr.FIA11-Jul-09 19:51 
Hello!
i'm making a mini-game by MFC
i want to make a class to ctrl some bitmaps,
i've written some menber founctions like this:
.................
in the constructor:
{
bitmap.loadbitmap...
xxx=0...//a bool to make sure CreateCompatibleDC(pDC) will only run once time.
}
setDC(CDC pdc);
{
if(xxx==0)
{
mDC.CreateCompatibleDC(pdc);// mDC used to store the picture
xxx=1
}
mDC.SelectObject(&bitmap[i]);
PDC=pdc;// PDC to store the target CDC
}
draw()//draw the picture
{
PDC->BitBlt(0,0,600,450,&mDC,0,0,SRCCOPY);
}
...........
but there's a problem:
when i use this class as a menber of CView; everything's OK ;

but when i use this class as menber of class X,and make X a menber of CView;
while using the founction setDC ;the mistake appears! a messagebox of"A\Retry\Ignore" comes out!!!

why things can be like this??
how should i write this class?

i just call setDC in founction"OnDraw".

modified on Sunday, July 12, 2009 4:12 AM

AnswerRe: A CLASS TO CONTROL SOME BITMAPS Pin
«_Superman_»11-Jul-09 19:53
professional«_Superman_»11-Jul-09 19:53 
QuestionRe: A CLASS TO CONTROL SOME BITMAPS Pin
Dr.FIA11-Jul-09 20:02
Dr.FIA11-Jul-09 20:02 
QuestionRe: A CLASS TO CONTROL SOME BITMAPS Pin
«_Superman_»11-Jul-09 20:15
professional«_Superman_»11-Jul-09 20:15 
QuestionRe: A CLASS TO CONTROL SOME BITMAPS Pin
Dr.FIA11-Jul-09 20:50
Dr.FIA11-Jul-09 20:50 
QuestionI need help about searching and deleting files? Pin
jon ray11-Jul-09 17:47
jon ray11-Jul-09 17:47 
AnswerRe: I need help about searching and deleting files? Pin
Hamid_RT11-Jul-09 19:43
Hamid_RT11-Jul-09 19:43 
AnswerRe: I need help about searching and deleting files? Pin
«_Superman_»11-Jul-09 19:51
professional«_Superman_»11-Jul-09 19:51 
GeneralRe: I need help about searching and deleting files? Pin
jon ray11-Jul-09 20:09
jon ray11-Jul-09 20:09 
GeneralRe: I need help about searching and deleting files? Pin
«_Superman_»11-Jul-09 20:13
professional«_Superman_»11-Jul-09 20:13 
Questiona Class Decleration ?? Pin
csipahi11-Jul-09 14:30
csipahi11-Jul-09 14:30 
AnswerRe: a Class Decleration ?? Pin
Stuart Dootson11-Jul-09 15:18
professionalStuart Dootson11-Jul-09 15:18 
QuestionInterupting a Loop Pin
KinXen11-Jul-09 14:12
KinXen11-Jul-09 14:12 
AnswerRe: Interupting a Loop Pin
Adam Maras11-Jul-09 15:15
Adam Maras11-Jul-09 15:15 
QuestionRe: Interupting a Loop Pin
David Crow11-Jul-09 15:44
David Crow11-Jul-09 15:44 
Questionsocket api's recv and UTF-8 Pin
invictus311-Jul-09 13:04
invictus311-Jul-09 13:04 
AnswerRe: socket api's recv and UTF-8 Pin
Nemanja Trifunovic11-Jul-09 13:41
Nemanja Trifunovic11-Jul-09 13:41 
AnswerRe: socket api's recv and UTF-8 Pin
markkuk12-Jul-09 6:41
markkuk12-Jul-09 6:41 

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.