-
April 9th, 2004, 01:39 PM
#1
C++ code w/ a C# GUI???
I am currently working on a large simulation for a programming class. We had to code the entire thing in C++ (I use 6.0) and then simply display information in the console window. However, we get extra credit if we add extra features to the simulation. Which brings me to my question:
Is there an easy way to create a GUI (in either C# or MFC, but preferably C#) that works in conjunction with my C++ code?
The GUI will need to update its display each time the simulation processes an event.
Any suggestions will be greatly appreciated!
-
April 9th, 2004, 01:51 PM
#2
If you use a C# GUI with C++ code, you're going to have to compile your C++ code into a DLL and import each function into the C# application and access them that way.
Your best bet would be to use something like qt or wxWidgets.
Impress your professor and show him you have a C++ program that works on Windows, Linux and Mac OS
-
April 9th, 2004, 01:51 PM
#3
Create a C++ static library (ie API) of your C++ program.
Then you have two options:
1. Create a COM wrapper
2. Create a C++.NET library wrapper (you'll probably need VC.NET for this)
After you've done the above things, it is very easy to use and call C++ code that implements the simulation stuff, from C# (or any other .NET language). I would guess option #2 is some what easier, but if you only have VC6, you may have to go for the first option.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|