Original Post
If I include the following code in my EXE (ie. if I merely compile it in, it's not being used anywhere in the code), my program crashes: If I comment out that block of code right there, all is well and there is no problem. I get an access violation when that's included inside the XSTRING header that's part of VC++ in this function: I'm using Visual C++ 6 with the latest service pack and I have the current platform SDK installed. I have no clue what's causing this.
typedef struct
{
// The name is the tooltip, the path is just that
string name, path;
vector<toolbarIcon_t> icons;
} toolbar_t;
vector<toolbar_t> getToolbars()
{
HKEY rootKey;
vector<toolbar_t> toolbars;
if (RegOpenKey(HKEY_CURRENT_USER, "Software\\Toolbar", &rootKey) != ERROR_SUCCESS)
{
setupRegistry();
return getToolbars();
}
RegCloseKey(rootKey);
return toolbars;
}
_Myt& assign(const _Myt& _X, size_type _P, size_type _M)
{if (_X.size() < _P)
_Xran();
size_type _N = _X.size() - _P;
if (_M < _N)
_N = _M;
if (this == &_X)
erase((size_type)(_P + _N)), erase(0, _P);
else if (0 < _N && _N == _X.size()
&& _Refcnt(_X.c_str()) < _FROZEN - 1
&& allocator == _X.allocator)
{_Tidy(true);
_Ptr = (_E *)_X.c_str();
_Len = _X.size();
_Res = _X.capacity();
++_Refcnt(_Ptr); }
else if (_Grow(_N, true))
{_Tr::copy(_Ptr, &_X.c_str()[_P], _N);
_Eos(_N); }