If you are have CWGraph via Measurement Studio 1.0 or Measurement Studio 6.0, the easiest thing for you to do is install Measurement Studio for C++. This product contains MFC-based C++ classes that provide native C++ interfaces to the user interface ActiveX controls and to the hardware APIs such as VISA and GPIB. Measurement Studio for C++ also contains a wizard that creates projects that contain Measurement Studio components and a wizard that helps you add Measurement Studio components to existing projects.
If you are using CWGraph via an older version of ComponentWorks and you do not want to upgrade to Measurement Studio, you can use the C++ classes that Visual Studio generates for you. Right click on your Dialog, choose Insert ActiveX Control, and choose
CWGraph Control from the list. Right click on the control on the form and choose Class Wizard. Go to the Member Variables tab, choose the control ID of the graph, and click Add Variable. Visual Studio will prompt you for permission to generate wrapper classes. See MSDN documentation for more information on this process and on how to use these wrappers. Specifically, you will need to learn how to use the VARIANT data type in MFC/C++.
David Rohacek
National Instruments