locked
Forms invocation from class libraries RRS feed

  • Question

  • Hi All,
    I have a COM application (closed source) that i have extended using C# class libraries and COM interop. I would like tobe able to chart data from the domain i control for testing and functional purposes. However, as i'm an amateur and ddoing this in my spare time it is not entirely clear how I should do that from what is a class library.

    Can someone either exaplain to me what i should do or point me to a resource that does explain? All of the examples I see show charting as an application.

    Note: I'm looking to use the .Net 3.5 charting controls.


    Regards,
    David
    • Moved by nobugz Sunday, April 5, 2009 3:00 PM charting q
    Sunday, April 5, 2009 12:16 PM

Answers

All replies

  • Hi,
    I've made some attempt to get this working. I've created a line chart using form designer - fine. I'm initializing it in the constructor as follows:

         LineChart =

    new LineChart();

    Later i have some code that updates the chart:

         LineChart.Update(date, Value));

    The method called is:

     

         public void Update(double t, double v)

         {

              ChartView.Series[

    "series1"].Points.AddXY(

                   t,

                   v);

         }


    I've debugged this and see that the data does get added to the series - nothing gets drawn however. I'm clearly missing the code that draws and updates the chart. If you can clarify that I'll be very grateful.


    Regards,
    Dave

    Monday, April 6, 2009 9:33 AM
  • Chart is just a Windows Forms control and I would recommend to search for a solution how to add WF control to MFC application in general.

    Alex.
    http://blogs.msdn.com/alexgor
    Wednesday, April 8, 2009 8:16 PM