LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Stack Overflow

With CVI 7.0035 runtime under W2KSP i get a stack overflow after

iStatus=SetCtrlAttribute(iPanelHR,iGraphCopy,
ATTR_XYLABEL_FONT,"Arial");
iStatus=SetCtrlAttribute(iPanelHR,iGraphCopy,
ATTR_XYLABEL_POINT_SIZE,33);

Stack frames are listed in Visual C++ 6.0 debugger as

CVIRTE! 68473a3a()
CVIRTE! 6847b5f8()
CVIRTE! 684eb67a()
CVIRTE! 684eb51c()
CVIRTE! 684ea0d9()
CVIRTE! 684e9faa()
CVIRTE! 684ea02d()
CVIRTE! 684fd0be()
CVIRTE! 684f9f9e()
CVIRTE! 684a6bc8()
CVIRTE! 684a5ddd()
CVIRTE! 6850205f()
CVIRTE! 685035f4()
CVIRTE! 685026da()
CVIRTE! 68502864()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
CVIRTE! 684289e6()
CVIRTE! 685029aa()
CVIRTE! 6850d39a()
....

So there is a threefold recursion pattern plus some other calls immediately before crash.

The crash does not happen, if i show the right y axis labels before doing the call. But then a similar crash happens as soon as i try to hide the right y axis labels.

Could you propose some workaround? I have to get the x and left y axis labels in Arial 33pt.
0 Kudos
Message 1 of 5
(3,388 Views)
I forgot that cvirte.dll is version 7.0.0.395 and is loaded at 68420000. The SetCtrlAttribute() entry point is at 68583AFF.
0 Kudos
Message 2 of 5
(3,386 Views)
There was a bug in CVI 7.0 that could be causing this problem. To find out for sure, edit your graph control and disable autoscaling for the *top* x-axis. (even if you're not using the top x-axis). Then see if you can still reproduce the problem.

If you can no longer reproduce it, then it was most likely the same bug. The bug was fixed in CVI 7.1.

Luis
NI
Message 3 of 5
(3,369 Views)
Thanks for your advice, it seems to solve my problem.

Since i do not have the CVI 7 development environment, but my clients are using the 7.0 runtime environment, i just had to find out that

#define VAL_TOP_XAXIS 3 /* for graphs only */

Then i could call

iStatus=SetAxisScalingMode(iPanelHR, iGraphCopy, VAL_TOP_XAXIS, VAL_MANUAL, 0., 1.);

Do we have to do this for all graphs, in case one of our clients might use the 7.0 runtime? Will they get stack overflows occasionally? In my case the only offending graph until now gets created by a DuplicateCtrl() call. All others are loaded with panels from a UIR file.
0 Kudos
Message 4 of 5
(3,353 Views)

Yes, it can happen on any graph, whether it was created programmatically or loaded from a .UIR file. It's rare that it happens, but it's pretty hard to predict when it might happen. So, if none of your graphs need to use the top x-axis, it is safest to make that change on each one.

The other alternative would be to have your clients download the 7.1 runtime engine, which they can do for free from here. However, if you have an arbitrarily large number of clients, obviously this might not be practical.

Luis

0 Kudos
Message 5 of 5
(3,342 Views)