Click here to Skip to main content
15,891,136 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionC++ Builder Transparent Graphics! Pin
Debs*13-Feb-06 9:12
Debs*13-Feb-06 9:12 
AnswerRe: C++ Builder Transparent Graphics! Pin
olle13-Feb-06 9:56
olle13-Feb-06 9:56 
GeneralRe: C++ Builder Transparent Graphics! Pin
Debs*27-Feb-06 6:25
Debs*27-Feb-06 6:25 
GeneralRe: C++ Builder Transparent Graphics! Pin
Gordon Brandly2-Mar-06 10:45
Gordon Brandly2-Mar-06 10:45 
GeneralRe: C++ Builder Transparent Graphics! Pin
Debs*3-Mar-06 3:37
Debs*3-Mar-06 3:37 
GeneralRe: C++ Builder Transparent Graphics! Pin
Gordon Brandly3-Mar-06 15:11
Gordon Brandly3-Mar-06 15:11 
Questionshare dll data with application Pin
sap.cool13-Feb-06 0:36
sap.cool13-Feb-06 0:36 
Questionvisal studio 2003 MFC/SDI and help whit Cbrush Pin
ALTF412-Feb-06 0:54
ALTF412-Feb-06 0:54 
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<postaja[i].dolzina_vrste;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 Frown | :(
becouse sometimes the program finishes Ok sometimes not

///---there is no hope for you---\\\
QuestionConsole Output Formatting Pin
Brett Peirce10-Feb-06 15:22
Brett Peirce10-Feb-06 15:22 
AnswerRe: Console Output Formatting Pin
George L. Jackson10-Feb-06 17:28
George L. Jackson10-Feb-06 17:28 
QuestionHow to scroll text in dev c++ in c++ code? Pin
zeyan10-Feb-06 14:21
zeyan10-Feb-06 14:21 
AnswerRe: How to scroll text in dev c++ in c++ code? Pin
Cedric Moonen12-Feb-06 20:55
Cedric Moonen12-Feb-06 20:55 
GeneralRe: How to scroll text in dev c++ in c++ code? Pin
zeyan13-Feb-06 13:19
zeyan13-Feb-06 13:19 
AnswerRe: How to scroll text in dev c++ in c++ code? Pin
Ed K14-Feb-06 12:05
Ed K14-Feb-06 12:05 
QuestionWindows threads Pin
hyyppa10-Feb-06 1:51
hyyppa10-Feb-06 1:51 
AnswerRe: Windows threads Pin
toxcct10-Feb-06 2:06
toxcct10-Feb-06 2:06 
AnswerRe: Windows threads Pin
Eytukan16-Feb-06 4:54
Eytukan16-Feb-06 4:54 
QuestionLamp Control Pin
felixix9-Feb-06 10:48
felixix9-Feb-06 10:48 
AnswerRe: Lamp Control Pin
George L. Jackson9-Feb-06 12:14
George L. Jackson9-Feb-06 12:14 
QuestionWebBrowser Control Event problem on CE.Net Device Pin
daniel_godshall9-Feb-06 10:44
daniel_godshall9-Feb-06 10:44 
Questionoutputting text on-screen Pin
Peter Charlesworth9-Feb-06 7:32
Peter Charlesworth9-Feb-06 7:32 
AnswerRe: outputting text on-screen Pin
George L. Jackson9-Feb-06 12:29
George L. Jackson9-Feb-06 12:29 
QuestionMulti threaded programming Pin
RanjanShrestha9-Feb-06 7:23
RanjanShrestha9-Feb-06 7:23 
QuestionFind a string Pin
picasso29-Feb-06 7:20
picasso29-Feb-06 7:20 
AnswerRe: Find a string Pin
RanjanShrestha9-Feb-06 7:27
RanjanShrestha9-Feb-06 7:27 

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.