Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 2-Nov-20 8:08am
Comments
Shao Voon Wong 2-Nov-20 18:45pm    
Can you upload to GitHub, a sample project that reproduces the problem? Because I cannot find an addSubItem method that matches your arguments. You are not supposed to cast string literal to _variant_t: those are 2 different types.

1 solution

The NULL pointer assertion is the result, that you missed something. It sounds like you activated tooltips in some manner but dont provide them correctly. I would override the tooltip function to have full control about it or deactivate them.

Give that answer a shot.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900