Roger
2008-05-09 13:50:19 UTC
I have a simple test running on BCB 6 in a Console Application that
gives a Debugger Exception Notification of a raised exception
EAccessViolation when I try to do, say, vInt.resize(1) in the cpp file
as shown below. I would appreciate any help explaining what I am doing
wrong.
Thanks,
Roger
MyUtilities.h File:
#ifndef MyUtilitiesH
#define MyUtilitiesH
#include <vector>
class TUtilities
{
private:
protected:
public:
bool __fastcall TUtilities::Test();
std::vector<int> vInt;
};
extern TUtilities *MyUtils;
#endif
MyUtilities.cpp file:
#include "MyUtilities.h"
TUtilities *MyUtils;
bool __fastcall TUtilities::Test()
{
vInt.resize(1); // When I run it I get an Access Violation error
return true;
}
gives a Debugger Exception Notification of a raised exception
EAccessViolation when I try to do, say, vInt.resize(1) in the cpp file
as shown below. I would appreciate any help explaining what I am doing
wrong.
Thanks,
Roger
MyUtilities.h File:
#ifndef MyUtilitiesH
#define MyUtilitiesH
#include <vector>
class TUtilities
{
private:
protected:
public:
bool __fastcall TUtilities::Test();
std::vector<int> vInt;
};
extern TUtilities *MyUtils;
#endif
MyUtilities.cpp file:
#include "MyUtilities.h"
TUtilities *MyUtils;
bool __fastcall TUtilities::Test()
{
vInt.resize(1); // When I run it I get an Access Violation error
return true;
}