COleSafeArray::PutElement
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
I am trying to set up an 2D array using COleSafeArray but I get an error ("INVALID INDEX) when I set the index to include negative values. In short, I want an array with -10
You need to give index[1] some value, i.e., initialize the array. In the way you are using it the position 1 of the index has nothing in it. if you add something like index[1] = 0; before your for loop your code should work.