Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Bad Data type error when accessing PlotXvsY

After adding the CWGraph class to work space and corresponding Activex control. When I try to access
teh PlotXvsY function it returns with BAD Data Type
code:
const VARIANT x, y, z;
m_plot1.PlotY(x,y,z);
0 Kudos
Message 1 of 2
(2,864 Views)
If you have CWGraph from Measurement Studio 1.0 or Measurement Studio 6.0, I suggest installing Measurement Studio for Visual C++ and using those classes instead of the wrappers that MFC automatically generates for ActiveX controls. Measurement Studio for Visual C++ contains MFC C++ classes that provide native C++ interfaces to the ActiveX UI controls and to several hardware APIs. It also contains a project wizard to create new projects that use Measurement Studio classes and an add-in that lets you add Measurement Studio support to existing projects.

For example, the Measurement Studio for Visual C++ equivalent to CWGraph is called CNiGraph, and it has the following PlotY methods:

CNiGraph::PlotY(double x, double y);
CNiGraph::PlotY(const CN
iMatrix& y, double xFirst, double xInc, bool plotPerRow);
CNiGraph::PlotY(const CNiMatrix& y, bool plotPerRow);
CNiGraph::PlotY(const CNiMatrix& y);
CNiGraph::PlotY(const CNiVector& y, double xFirst, double xInc);
CNiGraph::PlotY(const CNiVector& y, double xFirst);
CNiGraph::PlotY(const CNiVector& y);

As you can see, these methods use strongly-typed C++ types for parameters and make it very difficult, if not impossible, to get a bad data type error when using them.

- Elton
0 Kudos
Message 2 of 2
(2,864 Views)