Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Using method ChartY of CWgraph with Visual C++ 6.0 and W98

Trying to plot real time sample with method ChartY of object CWGraph of Component Works 2.0.
OS W9X
Visual C++ 6.0
Each time the method is called the Free GDI objects available decrease. In two or three minutes, the GDI objects are all allocated. All the graphics system goes down.
The method is called inside a message Handler like this:
m_graphMonitor.ChartY(vDisplayedValue, vxAxisInc,vOptional);

where: vDisplayedValue is Y sample.
vxAxisInc is a (long) with the time inc.
vOptional is declared as COleVariant vOptional ((long) DISP_E_PARAMNOTFOUND, VT_ERROR);
0 Kudos
Message 1 of 4
(3,782 Views)
I was able to use the ChartY method in a loop executing 3000 times and saw no problem with the graphics system. I would recommend running the attached project to see if you see the same behavior. Modify the "On Chart One" function to run as many times as you wish. You can also model your variable declarations from this sample code.

regards,
Eric Meyer
National Instruments
Message 2 of 4
(3,782 Views)
Hi Eric,
Thank for your fast reply.
I tried to browse the knowledge base documents and I found an article that talks about Leaks in GDI using CVI and using Y label axis rotation, but I could open the document. I use this function too. Could be this my problem? I couldn't access to some contents on the Knowledge base.

regars,
0 Kudos
Message 3 of 4
(3,782 Views)
Yes, you are exactly right. This KnowledgeBase even has a link to a patch to fix the issue. Try accessing it again here


In case you have more trouble:
There is now a fixed version of the cwui control available for download. The file is stored at ftp.ni.com/support/compworks/windows/updates/cw201/cwui.ocx
    Note: This fix does not fix the problem with the GDI. Rather, it improves our usage of it so that the problem is less dramatic. If you change or update the caption frequently, you may still encounter problems due to t
    he leak.

0 Kudos
Message 4 of 4
(3,782 Views)