Why does this fail?

J

JoeC

class player{

string name;
graphic * gr;
void create();

public:
player();
graphic& gOut() {return *gr;} <- Wand to retrun the graphic for
display
void dummy(){MessageBox(NULL, "Dummy" , "Notice", MB_OK); }
};

graphic& space::graphicOut(){

if(play){return play->gOut();} <-Returning the graphics pointer
for display
if(seen){return *gr;}
else {return *grDefault;}
}

graphic& board::display(int y, int x){
return spaces[y][x].graphicOut();
}

gr = &maze->display(l2, l1);
gr->display(hwnd, l1*spacing, l2*spacing); <-crashes here
when I try to display the
graphic from the player.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top