Complicated C++ code, but the essence in pseudocode is:
I have a pGroup1 = CMFCPropertyGridProperty * with the following structure.
pGroup1
subGroup1ItemA("Numeric")
subGroup1ItemA_1("PI",(_variant_t) "3.14", "ratio" )
subGroup1ItemA_2("e",(_variant_t) "2.7182", "growth" )
subGroup1B("Text")
subGroup1C("Point")
This is established at runtime, works fine.
However, when I add, during subsequent user interaction:
subGroup1ItemA("Numeric").addSubItem("Phi",(_variant_t) "1.618", "gold" )
The program encounters a NULL pointer assertion in the DLL(mfc140ud.dll) when the mouse flies over the window containing these CMFCPropertyGridProperty objects.
What I have tried:
Swearing, hair-pulling.
Also, caught the exception but still have no idea which object's pointer in null.
Stepping through the code that adds this item works, and I can verify the added object is in the correct position of the altered node-header chain.