CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2015
    Posts
    450

    Display python script output into MFC window

    Hello,

    As you already helped me to plot a chart in python calling it in c++.
    the current output is into the console.

    Now I want to explore the option of moving the output plot into MFC window dialogue.
    Googling didnot help me much.

    Could you please advice me how to go about this ?

    thanks a lot
    pdk

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,110

    Re: Display python script output into MFC window

    Is it possible to redirect this output to some file?
    Victor Nijegorodov

  3. #3
    Join Date
    May 2015
    Posts
    450

    Re: Display python script output into MFC window

    Quote Originally Posted by VictorN View Post
    Is it possible to redirect this output to some file?
    Thankyou Victor for looking into this. As of now I have not tried to redirect. But i can try and update.

  4. #4
    Join Date
    Jan 2009
    Posts
    394

    Re: Display python script output into MFC window

    Quote Originally Posted by VictorN View Post
    Is it possible to redirect this output to some file?
    And to do what with this file ? After all, the request is to represent data (from a file or whatever) into a graphical form, form that Python is deliver into a Python windows (I guess, didn't check it). I am asking this because I don't understand what is the link between a file where you have the chart data and chart window, which is now delivered with a Python window.

  5. #5
    Join Date
    May 2015
    Posts
    450

    Re: Display python script output into MFC window

    Just to add some more inputs, when googling i found the following articles: (Not explored them yet). May be if anybody knows about these articles, will be helpful to post here:
    https://www.codeproject.com/Articles...-in-MFC-Dialog
    https://discourse.matplotlib.org/t/c...e-mode/10279/4

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,492

    Re: Display python script output into MFC window

    Quote Originally Posted by mesajflaviu View Post
    And to do what with this file ? After all, the request is to represent data (from a file or whatever) into a graphical form, form that Python is deliver into a Python windows (I guess, didn't check it). I am asking this because I don't understand what is the link between a file where you have the chart data and chart window, which is now delivered with a Python window.
    The source is python getting output to a console, not a window.

  7. #7
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,492

    Re: Display python script output into MFC window

    In my opinion you are on the wrong path here.

    If your app is MFC, you need to graph into a window that mfc has control over. Given this, having python run in a separate process and outputting a plot into a console window does not help you if the goal is to display a plot inside an MFC app.

    Find an MFC example that shows you how to plot. Another approach is to find a COM control (i.e. activex control) that can plot an host it inside the MFC app.

    You see an MFC app is designed to be a COM container and can host windows of COM controls (like you could host a window with an Excel chart for example).

    However, it isn't designed to host a console with with output from python.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured