none
opengl objects on CLR window RRS feed

  • Question

  •  

    Hi,
    I'm learning OpenGL using VC++ .NET 2005 and all I've been using so far is classic C++ using a Win32 console application (not very different from the DOS C++ I learnt in school).
    Now, the problem is that I want to make the jump to .NET (especially VC++, it looks interesting). In particular, I need to add an OpenGL console application to a windows form so as to control different parameters of my OpenGL program using simple windows controls like sliders, list boxes, etc.
    I've been looking around on the internet for almost a week now but I still cant figure out how to use .NET CLR (windows form application) to add a console app to a form.
    If there is anyone out there who could guide me, I'd be most grateful.
    Also, do you have any nice links to .NET tutorials for beginners? I dont want to learn MFC (bcz i found it too complicated), but want to just straight into .NET.

    Thanks a bunch!
    Nazia

    Saturday, November 29, 2008 6:47 AM

Answers

  • Hi dfdfdsfsdfdsf,

     

    Welcome to MSDN forum.

    I have read your post. Do you mean you want to start a console application in your winform application and transmit the data from the winform to the console? If my understanding is correct. You can use Process class to start your console appliation. Here is an example I have done for you.

     

    1. Build your console appliation in Visual Studio.

    2. Create your Windows Forms appliation with a button which will allow you to start console appliation when click.

    3. Write the code to the button click event handle method like this.

     

    Code in winform application

    Code Snippet

    using namespace System::Diagnostics;

    private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {

                                     Process^ pro = gcnew Process();

                                     pro->StartInfo->FileName = L"MyConsole.exe";

                                pro->StartInfo->Arguments = L"This is my console appliation";

                                     pro->Start();

                             }

     

     

     

    Code in console application

    Code Snippet

    #include "stdafx.h"

     

    using namespace System;

    using namespace System::Data;

     

    int main(array ^args)

    {

            System::String^ s = L"";

            int i = 0;

            for(i = 0; i < args->Length; i++)

            {

                    s += args[i]->ToString();

                    s += L" ";

            }

            Console::WriteLine(s);

            Console::ReadLine();

        return 0;

    }

     

     

     

    You can read this article .NET Framework Conceptual Overview for the concept of .net technology.

     

    If I misunderstood something, please feel free to tell me.

     

    Sincerely,

    Kira Qian

     

    Tuesday, December 2, 2008 4:12 AM

All replies

  • Hi dfdfdsfsdfdsf,

     

    Welcome to MSDN forum.

    I have read your post. Do you mean you want to start a console application in your winform application and transmit the data from the winform to the console? If my understanding is correct. You can use Process class to start your console appliation. Here is an example I have done for you.

     

    1. Build your console appliation in Visual Studio.

    2. Create your Windows Forms appliation with a button which will allow you to start console appliation when click.

    3. Write the code to the button click event handle method like this.

     

    Code in winform application

    Code Snippet

    using namespace System::Diagnostics;

    private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {

                                     Process^ pro = gcnew Process();

                                     pro->StartInfo->FileName = L"MyConsole.exe";

                                pro->StartInfo->Arguments = L"This is my console appliation";

                                     pro->Start();

                             }

     

     

     

    Code in console application

    Code Snippet

    #include "stdafx.h"

     

    using namespace System;

    using namespace System::Data;

     

    int main(array ^args)

    {

            System::String^ s = L"";

            int i = 0;

            for(i = 0; i < args->Length; i++)

            {

                    s += args[i]->ToString();

                    s += L" ";

            }

            Console::WriteLine(s);

            Console::ReadLine();

        return 0;

    }

     

     

     

    You can read this article .NET Framework Conceptual Overview for the concept of .net technology.

     

    If I misunderstood something, please feel free to tell me.

     

    Sincerely,

    Kira Qian

     

    Tuesday, December 2, 2008 4:12 AM
  • Hi Kira Qian

    actually you can understand my problem because there is no use of OpenGL you give in your reply, I want to use OpenGL on VC++.Net( CLR windows form application).

    Tuesday, January 27, 2009 4:33 AM