CArray: program crashes when it is not static - why ?
Posted on 2004-04-12
CArray<CString, CString> m_strNewTabURLs
in my main application class. There is also a function in this class that looks for a specified element of this CArray by looping through it. This function uses m_strNewTabURLs.GetSize() to determine how many elements there are.
In my application InitInstance(), I state
but when I come to get to the function call, I look at the debuggers output and find that it says that m_strNewTabURLs cannot be evaluated, hence the call to GetSize() crashes the code.
The thing is, when this CArray is static, everything is fine...
Why ? I have a std::vector in my app class that is not static, and that is fine !