Discussion:
Non-MFC GUI programming tutorial?
(too old to reply)
Morten Aune Lyrstad
2004-05-16 12:31:07 UTC
Permalink
Hi! MFC is starting to get on my nerves, and I'd like to get a little bit
deeper into c++ gui programming. Someone have a link to a good tutorial? I
know how to set up a window, but I would like to learn how to add controls
to that window. That is, _without_ using templates. I want to be able to
create a window according to user specifications, so it must be done at
runtime.
songie D
2004-05-16 12:40:22 UTC
Permalink
Be sure to give it a rating!
Post by Morten Aune Lyrstad
Hi! MFC is starting to get on my nerves, and I'd like to get a little bit
deeper into c++ gui programming. Someone have a link to a good tutorial? I
know how to set up a window, but I would like to learn how to add controls
to that window. That is, _without_ using templates. I want to be able to
create a window according to user specifications, so it must be done at
runtime.
songie D
2004-05-16 12:40:13 UTC
Permalink
Try
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=7651&lngWId=3
Then add new classes to it for your subcontrols.
Post by Morten Aune Lyrstad
Hi! MFC is starting to get on my nerves, and I'd like to get a little bit
deeper into c++ gui programming. Someone have a link to a good tutorial? I
know how to set up a window, but I would like to learn how to add controls
to that window. That is, _without_ using templates. I want to be able to
create a window according to user specifications, so it must be done at
runtime.
Morten Aune Lyrstad
2004-05-16 13:15:20 UTC
Permalink
Thank you, that probably solved another of my problems, but it is not really
what I was asking for. I have never created Windows-applications in C++
without MFC, so I need a crash course on creating and adding controls like
buttons, check-boxes, list-boxes etc.
Post by songie D
Try
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=7651&lngWId=3
Post by songie D
Then add new classes to it for your subcontrols.
Post by Morten Aune Lyrstad
Hi! MFC is starting to get on my nerves, and I'd like to get a little bit
deeper into c++ gui programming. Someone have a link to a good tutorial? I
know how to set up a window, but I would like to learn how to add controls
to that window. That is, _without_ using templates. I want to be able to
create a window according to user specifications, so it must be done at
runtime.
Scott McPhillips [MVP]
2004-05-16 14:41:04 UTC
Permalink
Post by Morten Aune Lyrstad
Thank you, that probably solved another of my problems, but it is not really
what I was asking for. I have never created Windows-applications in C++
without MFC, so I need a crash course on creating and adding controls like
buttons, check-boxes, list-boxes etc.
If you are under the impression that you have to omit MFC to create
controls at runtime then you haven't learned much MFC. Everything you
can do in a Win32 program can also be done in an MFC program.

To create apps in C++ without MFC you face an up-front problem that
Windows will not call an ordinary C++ member function as a wndproc. One
of several possible solutions is shown in the tutorials at
http://www.relisoft.com/

Here is the crash course you requested: To create controls at runtime,
with or without MFC, call CreateWindowEx for each control.
--
Scott McPhillips [VC++ MVP]
Morten Aune Lyrstad
2004-05-16 14:13:02 UTC
Permalink
No, I am not under the impression that I have to omit MFC to create controls
at runtime, I know that it is relatively easy to do so there. However, I do
no longer wish to use MFC, it's as simple as that :-)

"Scott McPhillips [MVP]" <***@mvps.org.nothere> skrev i melding
...news:***@TK2MSFTNGP10.phx.gbl...
songie D
2004-05-17 15:41:04 UTC
Permalink
Post by Morten Aune Lyrstad
However, I d
no longer wish to use MFC, it's as simple as that :-

Unfortunately, there's some people that for whatever reason simpl
don't understand that perfectly valid desire


"Scott McPhillips [MVP]" <***@mvps.org.nothere> skrev i meldin
....news:***@TK2MSFTNGP10.phx.gbl..
a.m.a
2004-05-16 21:36:25 UTC
Permalink
Post by Morten Aune Lyrstad
Hi! MFC is starting to get on my nerves, and I'd like to get a little bit
deeper into c++ gui programming. Someone have a link to a good tutorial? I
know how to set up a window, but I would like to learn how to add controls
to that window. That is, _without_ using templates. I want to be able to
create a window according to user specifications, so it must be done at
runtime.
I suggest ATL' s window classes. I have been using it for 3 years, never had
a problem.
muchan
2004-05-18 10:00:06 UTC
Permalink
Post by Morten Aune Lyrstad
Hi! MFC is starting to get on my nerves, and I'd like to get a little bit
deeper into c++ gui programming. Someone have a link to a good tutorial? I
know how to set up a window, but I would like to learn how to add controls
to that window. That is, _without_ using templates. I want to be able to
create a window according to user specifications, so it must be done at
runtime.
I don't use MFC but I use resource templates.

I think you can still use resource tenmplate made runtime,
using DialogBoxIndirectParam function and DLGTEMPLATE structure.

I have already made a dialog class with such runtime template mechanism
incorporated, but this is my *trade secret* ;) just a C++ implementation &
encapsulation of the functions and structure for programing interface
of my taste. :)

When I want to put control inside main window, I make a dialog template
that with child attribute and call it from the main window.
One sample program I wrote that way is VWDOF, a freeware for calculation of
photographic optics. <http://www.vanwalree.com/optics/vwdof.html>

I had years of Win32 programing in C, using only Windows API, and after
using MFC for a while, frustrated with its automation and inflexibility
of wizard generated codes, stoped using it and made my C++ classes for
Win32 programs. So, one suggestion is to look at sample code of C for
Windows application. Another is COM Tutorial Code Samples using ATL.
Start from a simple window program that doesn't do nothing, and build
your things into it learning Windows API one at a time...


muchan
Igor Tandetnik
2004-05-19 19:09:36 UTC
Permalink
Post by Morten Aune Lyrstad
Hi! MFC is starting to get on my nerves, and I'd like to get a little
bit deeper into c++ gui programming. Someone have a link to a good
tutorial? I know how to set up a window, but I would like to learn
how to add controls to that window. That is, _without_ using
templates. I want to be able to create a window according to user
specifications, so it must be done at runtime.
See if this helps:

http://www.thecodeproject.com/wtl/wtl4mfc1.asp
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Loading...