Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Debug assertion failure when using dynamic graph

I dynamicly create a view graphs on a document/view in the view window. Like this:
c_LevelGraph2.Create("", WS_VISIBLE, CRect(0,0,200,200),this, 0,NULL, FALSE, bstrLic);
c_LevelGraph3.Create("", WS_VISIBLE, CRect(400,400,600,600),this, 0,NULL, FALSE, bstrLic);

And when I run the program I get a debug assertion failure in wincore.cpp on line 312
This happends when the second graph is created.
Can anyone tell me what I am doing wrong?
0 Kudos
Message 1 of 2
(3,174 Views)
Hello

From what I can tell, the thing that sticks out is that you gave both controls the same nID parameter in Create. I think MFC keeps track of CWnd handles by using a map, and each nID item has to be unique. So try something like the following

c_LevelGraph2.Create("", WS_VISIBLE, CRect(0,0,200,200),this, 1001,NULL, FALSE, bstrLic);
c_LevelGraph3.Create("", WS_VISIBLE, CRect(400,400,600,600),this, 1002,NULL, FALSE, bstrLic);

Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
Message 2 of 2
(3,174 Views)