07-12-2005 05:00 PM
07-13-2005 08:42 AM
07-13-2005 10:13 AM
Hi,
I am just trying to plot an array of points onto an AxCwGraph component. Yes, I am using a .Net project. The method I want to use to plot my points is PlotXvsY(System::Object __gc, System::Object__gc);
I am assuming the parameters that are passed in are x and y values. So you are mentioning that I do not even need to use the Interop interface? All the examples I am seeing are using MFC classes. So you are saying that I need to use unmanaged MFC classes? I apologize, but I do not understand the terminology.
Let me know if you want anymore input. Thanks!
07-13-2005 10:15 AM
07-13-2005 10:48 AM
The examples that you are looking at are for the Measurement Studio C++ interfaces, which are MFC-based classes that are intended to be used from unmanaged C++ applications. The Measurement Studio C++ UI classes are custom C++ interfaces to ActiveX controls and use native Measurement Studio C++ data types, such as CNiVector. If you are creating a .NET Windows Forms project, you must use .NET Windows Forms controls on the form. You cannot use the Measurement Studio C++ UI classes on a .NET Windows Forms form. The AxCWGraph class that you are using is a .NET interop wrapper around the CWGraph ActiveX control. There are no C++ examples that demonstrate using the ActiveX control in this manner.
The interop wrapper approach will work, but I suggest using the controls that are native to the type of application that you are writing. This means that if you're writing an unmanaged C++ application with MFC, use the CNiGraph class, and if you are writing a .NET Windows Forms application, use the native Measurement Studio .NET Windows Forms graphs, which are called WaveformGraph and ScatterGraph. These graphs accept .NET data types and will be much easier to use from a .NET application.
- Elton
07-13-2005 10:52 AM
The CNi classes are MFC-based C++ classes, so yes, you need to use an unmanaged MFC project to access these types. Another option is that you can create a Managed C++ project and use both .NET and C++ data types (including the CNi classes) in the application. However, a .NET Windows Forms form works with .NET controls only, so you will not be able to use the CNi UI classes in this type of application.
- Elton
07-13-2005 11:01 AM
07-13-2005 11:23 AM
Ok,
I just played around with measurement studios, and it seems I have to remake a brand new MFC project. I am foreign to this format. I assume this is the conventional way on using graph plotting functions. This is a big problem for me because I am writing a larger program all based on the windows form project template. Because the graph controls are going to be in MFC, I have to rewrite the whole program using the MFC template.
Is there some way of incorporating the plot functions under the window forms template? I guess this is my main question throughout this thread. If I use the plot functions in windows form, it complains because I am not passing CNiVector into its parameters. I hope this makes my problem clearer. Thank you very much for your time!
07-13-2005 12:01 PM
Please see my response on this thread. Thanks.
- Elton