Link to home
Start Free TrialLog in
Avatar of boodabelly
boodabelly

asked on

C++ form creation at run-time

Does anyone have any resources on creating forms in C++ without using MFC.  I know this is the hard way to do things.
Avatar of boodabelly
boodabelly

ASKER

Edited text of question.
Forms?  You mean windows?  You can just use CreateWindow() or CreateWindowEx().  What specifically do you want to know about?
ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
By forms, I guess boodabelly means dialog boxes that contain various controls. What do you want to do?

Yeah, sorry for not being clear.  I was programming in VB for a while and that is what the referred to windows as.  I need to make something like a "form" or "windows".  I am trying to make a heads up display for a game and dont have one yet.  Ill see what I can do with the code that neitod posted.  Or I guess it would be easier to create the graphics and just put them on the screen.
If you need really fast graphics, you might want to look into direct draw.  It a lot more complex thant standard windows graphics, but much more poserful too.

If you don't go the direct draw route, you still will need the to create windows, i.e the code i posted.  Then you will probably want to output the graphics by drawing to an off-screen bitmap and then copyingthe bitmap into your window with BitBlt().

If you are starting windows program through the windows API, you need to get a a good introductory book on windows programming, like Teach Youself Windows in 21 days or the charles Petzold book, whose name has escaped me at the moment.
I have a book on Direct Draw & DX6 and game programming for drawing bitmaps off screen and then putting them on the screen.  I am trying to port the code for linux, so I didnt know if there was a viable ( easy ) alternative to that with out having to write a whole lot of classes to handle the graphics in linux.  It might be easier just to stick with windows programming though.  I'll give it a try, but I think for the time being DirectX is the way to go.

Off the subject, do you know if linux supports OpenGL?  I havent checked on that alternative yet.
I have no idea.
AFAIK there's a library called MESA which is an implementation of OpenGL for LINUX
To create a window("form") under Linux is a different story with under Windows. You can't use the standard Windows API, you may choose some existing library like Gtk+, Qt, wxWindow (cross-platform) to do the GUI programming under Linux.

For OpenGL implementation, try this: http://linux.box.sk/box.php3?prj=linux&gfx=linux&srch=OpenGL
www.wxwindows.org has example source using MDI. It is a framework built similar to MFC, though. It also has a library and example source to support OpenGL called glcanvas, allowing graphics in any kind of window,i.e., scrollable, resizeable.
wxWindows source works for Linux, Win32, MacOS, etc.
sorry it took so long