LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add/reference a ValuePair object in CwGraph?

Hi,

I'm using the CWGraph ActiveX control from MS 7 under LW/CVI 7.0 (Windows XP).
Everything worked fine up until now, although the lack of documentation/example code for CVI concerning CwGraph makes things a bit tough to figure out (I only found documentation related to VB/VC++).

But now, I can't figure out how to add a value pair to a given axis. The way I understand things, a VP is related to a given axis, so I use the following code to add a VP:

CAObjHandle axesHandle, yAxis, vpHandle;
/* Obtain handle for Y-axis */
ret = CWUIControlsLib_CWAxisItem(axesHandle, NULL, CA_VariantInt(2), &yAxis);
/* Add a ValuePair object to the axis */
ret = CWUIControlsLib_CWValuePairsAdd(yAxis, NULL, &vpHandle);

The first function returns 0 (I even changed min/max values for the axis to verify that I obtain the right handle).
But the second one fails with "Interface is not registered" (translation of the French message).

If anyone could point out what I'm doing wrong, it would be greatly appreciated.

Sincerely,
Viktor STARK
0 Kudos
Message 1 of 2
(2,748 Views)
Problem solved.
Solution is using CWUIControlsLib_CWAxisGetValuePairs().
I wish I could be using some object oriented language instead of having to obtain the handle of the handle of the handle... just to change a label.

0 Kudos
Message 2 of 2
(2,746 Views)