Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Leak when use NI ActiveX control in Borland C Builder6.0.

Memory Leak When I use Variant array to Plot graph as PlotY(...). How can I do? thanks!
0 Kudos
Message 1 of 7
(3,932 Views)
Hi,

One thing to keep in mind is that the graph has to keep it's own copy of the ploted data. This is required to be able to redraw the graph and other operations.

What version of Measurement Studio are you using?
How are you monitoring this leak?

Keep me posted!

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 7
(3,932 Views)
Very Thanks of your answered.
I am using Measurement Studio 6.0 in Borland C++ Builder 6.0 to plot the data get from A/D.Because the data is continious wave,so I must continue to plot graph. When I plot graph, the system memory continue to be exhausted.I monitoring this leak in task manager and use GlobalMemoryStatus() function.
In Borland C++ Builder 6.0, I use NI ActiveX control as this sample code:
/////////////////////////////////////////////////////
for(int i=0; i<16; i++)
{
Graph->Plots->Item(Variant(i+1))->ClearData();
Variant data=VarArrayCreate(OPENARRAY(int,(0, len)), varDouble);
for(j=0;j Variant ele= double;
data.PutElement(&ele,j);
}
Graph->Plots->Item(Variant(i+1))->PlotY(data,Variant((double
)0),Variant((double)5));
}
//////////////////////////////////////////////
Is there some wrong in this code?
Thanks!
0 Kudos
Message 3 of 7
(3,932 Views)
Now I found the memory leak is cause by #include "windows.h" and compile model in Borland C++ Builder 6.0. Only When I use Debug Model without #include "windows.h", There are not Memory leak.
If the code in Release Model or #include "windows.h", the memory leak is occurrence!
But I don't know the reason of the problem,Can you tell me? Thanks!
If this error is caused by the version of measurement studio activeX control? or Update the measurement studio to 7.0 can fix the error? Or measurement studio only be run well in VC++ or VB ? not support C++Builder 6.0?

Wait for your answer! thank!

Regards,
Huaxu
0 Kudos
Message 4 of 7
(3,932 Views)
Excuse me!
Who can help me?
I found if I include "windows.h" in my program ,I can find memory leak in TaskManager!My program only Loop to plot a graph in TCWGraph Class.
My program use Measurement Studio 6.0 ActiveX Control In Borland C++6.0, OS is Win2000 pro.
Is this bug only in Measurement Studio 6.0? is Ver7.0 OK?
wait for answer! Very Thanks!!!
0 Kudos
Message 5 of 7
(3,932 Views)
I am having similar issue! Have you found a solution?

Kind Regards,

Brad
0 Kudos
Message 6 of 7
(3,932 Views)
Hi,

i have question, i would like to use real time data acquition using borland c++ builder 6.0, is there any active x components from NI , thorugh which we can acquire the data from sound card.
I would appreciate youe valuable information.
With regards,
ramesh V
0 Kudos
Message 7 of 7
(3,932 Views)