问题描述
我在VC ++ 2008中使用Windows窗体制作了一个图表,该图表使用Zedgraph.dll制作了函数函数图,但是在示例中,我现在想显示数据,以便在计算时实时或最小程度地显示数据.以动态形式逐步进行.我知道Wiki中有一个示例:
http://www.zedgraph.org/wiki/index.php?title=Display_Dynamic_or_Real-Time_Data [^ ]
但是它有C#的示例,并且包含一个转换,我无法使用c#代码在VC ++中很好地运行:
LineItem curve = zedGraphControl1.GraphPane.CurveList [0]作为LineItem;
和
IPointListEdit list = curve.Points为IPointListEdit;
和VC ++ 2008没有"as"运算符,它会产生2个错误,这仅是问题.
I have a pogram in VC++ 2008 made with Windows Forms that make a matematic function graph with the Zedgraph.dll how in examples, but I want now to show the data, while it is computing, to show data real time or minimal in dynamic form step by step. I know that there is an exmple in the wiki:
http://www.zedgraph.org/wiki/index.php?title=Display_Dynamic_or_Real-Time_Data[^]
but it has the example in C# and it includes a conversion that I can´t make run good in VC++ with the c# code:
LineItem curve = zedGraphControl1.GraphPane.CurveList[0] as LineItem;
and
IPointListEdit list = curve.Points as IPointListEdit;
and VC++ 2008 don´t have "as" operator and it generate 2 errors, this is only the problem.
推荐答案
LineItem ^curve = dynamic_cast<LineItem ^>(zedGraphControl1->GraphPane->CurveList[0]);
而另一行:
And the other line:
IPointListEdit ^list = dynamic_cast <IPointListEdit^>(curve->Points);
在C ++中,使用"dynamic_cast"运算符都可以很好地工作
All works good with "dynamic_cast" operator in C++
这篇关于如何在VC ++ 2008中使用Zedgraph.dll显示实时或动态数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!