Mail Archives: djgpp/1999/12/22/19:49:26
Valkir <jfd50 AT videotron DOT ca> schreef in artikel
<14684.897$Qz2 DOT 16629 AT wagner DOT videotron DOT net>...
> Here's the code:
> int main()
> {long x,y;
> uchar *Video;
> Buffer=(uchar *)malloc(1920000);
> cVesa *Vesa=(cVesa *)malloc(sizeof(cVesa));
So Vesa is a pointer to some unknown struct to some allocated memory here.
> Video=Vesa->InitVesa();
Maybe my brain is going funny here, but you are calling a function pointer
that
is part of the struct, but the struct has not been initialized yet. I take
it that InitVesa
is a function pointer that is part of the struct. Where is this InitVesa
function and what does it look like?
> //////// cDesktop *Deskt=(cDesktop *)malloc(sizeof(cDesktop));
> for(x=0;x<800;x++)
> for(y=0;y<2400;y++)
> *(Buffer+y*800+x)=x;
>
> memcpy(Video,Buffer,1920000);
> getkey();
> Vesa->Close();
Another function call to the struct that is (as far as I can tell)
is still unitialized, i.e. filled with garbage.
> return(0);
> }
I hope this helps
Doug Eleveld
- Raw text -