Using windows forms in C++

May 14, 2010 at 9:20pm
Hi,

I am currently designing a program for a complex robot. Does anybody know how I can implement a windows form file in my c++ program (The form is already made, I just need to access it using my c++ program)?

would it be "#using <name_of_form>" in the library?

Thanks for the help.
May 14, 2010 at 9:47pm
Check this out -> http://www.fltk.org/doc-2.0/html/index.html

EDIT: Sorry, this may not be what you want... Say again, what exactly do you want?
Last edited on May 14, 2010 at 11:50pm
May 16, 2010 at 2:31am
Sure, what I am doing is designing a C++ program that references a windows forms file (.frm), meaning including the information stored in it, but I am not exactly certain how to do it. The file has buttons I need to execute the commands for the robot.
May 16, 2010 at 10:54am
So, what you want to do is to parse an frm file? I don't think there are libs to do the job for you... You'll have to do it yourself. I think frm files have text format (at least the ones related with visual basic), so it shouldn't be too hard. But after you get the information how exactly do you intend to use it? I didn't get that part... Does the robot have a screen, and you're gonna make the form appear there? You already have the API to draw the form and you just wanted to be able to read a form from an frm file?
May 17, 2010 at 2:22pm
Ok. Yeah when I run the .exe program the form comes up and I am able to move the robot in any direction, for only a short period of time, by clicking the desired direction button once. What I intend to do is change the code so the robot will travel as long as I am clicking and holding the button down.
May 17, 2010 at 3:34pm
The .frm file is a proprietary, Visual Basic-specific file for storing information that VB uses to re-create a Windows "window" (what your VB IDE calls a "form").

I cannot find a reference to the file format (there probably isn't a very good one, since MS can change it to match a specific version of VB), but google around a bit. You might even find a simple C or C++ library to load one for you (though I think it unlikely...).

If you really want to create a window in C++, use the Win32 function CreateWindow()
http://www.google.com/search?btnI=1&q=msdn+CreateWindow

It isn't difficult, but takes a little work to get it right.
http://www.google.com/search?q=createwindow+tutorial

Good luck!
May 17, 2010 at 3:35pm
For holding the button down, you can check the key state (something like GetAsyncKeyState()) or properly handle the keyboard input in your window's Window Procedure.
May 17, 2010 at 4:18pm
Awesome I will try that. Thanks a lot for the help guys!
Topic archived. No new replies allowed.