Click here to Skip to main content
15,886,783 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help?? How to Fade out text using CStatic Pin
LivingThoughts12-Feb-06 16:24
LivingThoughts12-Feb-06 16:24 
QuestionScrollbar in CFormView does not work,why? Pin
lostangels12-Feb-06 4:46
lostangels12-Feb-06 4:46 
AnswerRe: Scrollbar in CFormView does not work,why? Pin
Optimus Chaos12-Feb-06 5:57
Optimus Chaos12-Feb-06 5:57 
QuestionScrollbar in CFormView does not work,why? Pin
lostangels12-Feb-06 4:42
lostangels12-Feb-06 4:42 
QuestionCalling .m files from C++ Pin
misugi12-Feb-06 2:49
misugi12-Feb-06 2:49 
AnswerRe: Calling .m files from C++ Pin
Nick_Kisialiou12-Feb-06 9:56
Nick_Kisialiou12-Feb-06 9:56 
GeneralRe: Calling .m files from C++ Pin
misugi13-Feb-06 22:23
misugi13-Feb-06 22:23 
Questionvisual studio 2003 MFC/SDI help drawing Pin
ALTF412-Feb-06 1:02
ALTF412-Feb-06 1:02 
ok I have made a program that simulates a petrol station (comming of cars etc..)

it is a single MFC /SDI app in witch I made 2 functions first one delets the screen and the second one draws someting on the screen. I call this functions whit a timer (every 100ms)


but there is a problem sometimes my program crashes and this is all that I get as help why it crashed

Unhandled exception at 0x7c28af6a (mfc71d.dll) in seminarska.exe: 0xC0000005: Access violation reading location 0x00000004.

So I'm sure that the problem is in this 2 functions :
becouse if I run the program whit no drawing the program never crashes:

ok here is the code for deleteing the screen:

void CseminarskaView::brisi_ekran(void)
{
CDC*tabla=GetDC();
RECT Okno;
GetClientRect(&Okno);
CBrush copic(0xffffff);
tabla->FillRect(&Okno,&copic);
}

and the code for drawing :

void CseminarskaView::risi(Bencinska postaja[])
{
//tukaj moram risati sproti

CDC* tabla=GetDC();
RECT ena;
ena.top=20;
ena.left=20;
ena.right=60;
ena.bottom=60;
int x1=0;
int x2=0;
int x3=255;
int y=25;
CString nizi;
int i ;
for (i=0;i<5;i++)
{
CString out;
out.Format("%i",i+1);
tabla->TextOut(10,y,out);
CBrush pisalo(RGB(x1,x2,x3));
tabla->FillRect(&ena,&pisalo);
ena.top=ena.top+60;
ena.bottom=ena.bottom+60;
x1=x1+60;
x2=x2+60;
x3=x3-60;
y=y+60;

//delete pisalo;
}
CString uu;
y=25;int y1=500;
for( i=0;i<5;i++)
{
for(int j=0;j
{ nizi=nizi+" I ";
}
tabla->TextOut(80,y,nizi);
y=y+60;
nizi=" ";
uu.Format("postaja %i: %f",i,postaja[i].rezervar);
tabla->TextOut(10,y1,uu);
y1=y1+20;
}



}

can someone please help me ?
I think that the problem is CBrush but I'm not sure
becouse sometimes the program finishes Ok sometimes not



///---there is no hope for you---\\\
AnswerRe: visual studio 2003 MFC/SDI help drawing Pin
try8812-Feb-06 6:28
try8812-Feb-06 6:28 
GeneralRe: visual studio 2003 MFC/SDI help drawing Pin
ALTF412-Feb-06 6:39
ALTF412-Feb-06 6:39 
Questionproblem with CSocket Pin
hamidreza_buddy12-Feb-06 1:00
hamidreza_buddy12-Feb-06 1:00 
AnswerRe: problem with CSocket Pin
ALTF412-Feb-06 1:06
ALTF412-Feb-06 1:06 
GeneralRe: problem with CSocket Pin
Jörgen Sigvardsson12-Feb-06 2:41
Jörgen Sigvardsson12-Feb-06 2:41 
AnswerRe: problem with CSocket Pin
Rob Caldecott12-Feb-06 2:18
Rob Caldecott12-Feb-06 2:18 
AnswerRe: problem with CSocket Pin
ScottMcP14-Feb-06 8:55
ScottMcP14-Feb-06 8:55 
Questiona problem with Activex Control Pin
hamidreza_buddy12-Feb-06 0:51
hamidreza_buddy12-Feb-06 0:51 
AnswerRe: a problem with Activex Control Pin
Ryan Binns12-Feb-06 12:38
Ryan Binns12-Feb-06 12:38 
QuestionNumber of files and folders Pin
kelprinc12-Feb-06 0:47
kelprinc12-Feb-06 0:47 
AnswerRe: Number of files and folders Pin
__int6412-Feb-06 7:03
__int6412-Feb-06 7:03 
GeneralRe: Number of files and folders Pin
kelprinc13-Feb-06 1:11
kelprinc13-Feb-06 1:11 
QuestionClistCtrl - centralize image Pin
codepr11-Feb-06 22:43
codepr11-Feb-06 22:43 
AnswerRe: ClistCtrl - centralize image Pin
Gary R. Wheeler12-Feb-06 6:18
Gary R. Wheeler12-Feb-06 6:18 
GeneralRe: ClistCtrl - centralize image Pin
try8812-Feb-06 6:32
try8812-Feb-06 6:32 
GeneralRe: ClistCtrl - centralize image Pin
codepr12-Feb-06 21:09
codepr12-Feb-06 21:09 
GeneralRe: ClistCtrl - centralize image Pin
Gary R. Wheeler13-Feb-06 0:56
Gary R. Wheeler13-Feb-06 0:56 

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.