I keep getting these access violations, and the line the program seems to
stop on is


string Character::getIMFileName() { return imageMapFileName; }



Her'e the Character class:



class Character

{

private:

string name;

int curHP;

int curMP;

int maxHP;

int maxMP;

int xPos;

int yPos;

string imageMapFileName;

int curImage;

public:

Character(void);

~Character(void);

string getName();

void setName(string n);

int getCurHP();

void setCurHP(int hp);

int getCurMP();

void setCurMP(int mp);

int getMaxHP();

void setMaxHP(int hp);

int getMaxMP();

void setMaxMP(int m);

string getIMFileName();

void setIMFileName(string fn);

int getX();

void setX(int x);

int getY();

void setY(int y);

int getCurImage();

void setCurImage (int ci);

};



imageMapFileName is set with

void Character::setIMFileName(string fn) { imageMapFileName = "./" + fn; }



That method is being called, but for some reason, imageMapFileName is not
being set.  When I set a breakpoint on the setIMFileName line and run it,
down in the Watch window it says "  imageMapFileName CXX0069: Error:
variable needs stack frame".  What is this stack frame?   When the
getIMFileName method gets called and the program fails, this is in the watch
window:



-  imageMapFileName {_Bx={...} _Mysize=??? _Myres=???
} std::basic_string<char,std::char_traits<char>,std::allocator<char> >
+  [actual members] {_Bx={...} _Mysize=??? _Myres=???
} std::basic_string<char,std::char_traits<char>,std::allocator<char> >


[Non-text portions of this message have been removed]

Reply via email to