Skip to main content
removed the winapi/wndproc errors because this isn't about them
Source Link
Roger Pate
Roger Pate

C++ vectors giving runtime errors Runtime error accessing a vector

So, inIn my C++ project, I have a class App, and a class Window. Class App has a parameter: vector<Window*>* window;.

In App's constructor, it is able to use and push_back a Window* onto this vector fine, but in my onMessage() method, which is called by the WndProc() (I'm using winAPIwinapi), it gives me run-time errors and breaks my codean runtime error when I try to use the vector. These are access errors.

What on earth could be going wrong? If you need any more info, just ask.

Thanks in advance!

C++ vectors giving runtime errors

So, in my C++ project, I have a class App, and a class Window. Class App has a parameter: vector<Window*>* window;.

In App's constructor, it is able to use and push_back a Window* onto this vector fine, but in my onMessage() method, which is called by the WndProc() (I'm using winAPI), it gives me run-time errors and breaks my code when I try to use the vector. These are access errors.

What on earth could be going wrong? If you need any more info, just ask.

Thanks in advance!

Runtime error accessing a vector

In my C++ project, I have a class App, and a class Window. Class App has a parameter: vector<Window*>* window;.

In App's constructor, it is able to use and push_back a Window* onto this vector fine, but in my onMessage() method, which is called by the WndProc() (I'm using winapi), it gives me an runtime error when I try to use the vector. These are access errors.

What on earth could be going wrong? If you need any more info, just ask.

edited tags
Link
Matthew Flaschen
  • 286.3k
  • 53
  • 523
  • 554
Source Link

C++ vectors giving runtime errors

So, in my C++ project, I have a class App, and a class Window. Class App has a parameter: vector<Window*>* window;.

In App's constructor, it is able to use and push_back a Window* onto this vector fine, but in my onMessage() method, which is called by the WndProc() (I'm using winAPI), it gives me run-time errors and breaks my code when I try to use the vector. These are access errors.

What on earth could be going wrong? If you need any more info, just ask.

Thanks in advance!