Solved

help with Edit Box error in visual C++ 6 tutorial

Posted on 2006-07-19
6
224 Views
Last Modified: 2010-04-24
The following tutorial on visual C++ 6.0
html -
http://www.google.com/search?q=cache:LD-M1Dqi8xcJ:hsc.csu.edu.au/sdd/core/package/solution_package/tutorials/visualc_tutorial.pdf+MFCAppWizard(exe)+tutorial&hl=en&gl=jm&ct=clnk&cd=3&client=firefox-a

pdf -
http://hsc.csu.edu.au/sdd/core/package/solution_package/tutorials/visualc_tutorial.pdf

 says to add 3 edit boxes to the dialog and change their caption to Red, Green and Blue.  The edit boxes don't have a caption property.  Therefore the relevant part of the code gives error when I try to build.  Tried to use the Static Text control instead but it can't work.  Seeking a correction.

The instructions are on page 6 (pdf) of the tutorial. Title - Activity 2 Colour Changer, the second bulleted paragraph says to add 3 edit boxes to the dialog.  The next paragraph says to right the labels, choose properties and change their caption to Red, Green and Blue.  The edit boxes don't have caption property.
0
Comment
Question by:yunikon
  • 3
  • 2
6 Comments
 
LVL 15

Expert Comment

by:lakshman_ce
ID: 17139885
They mean the labels. ie. Static text from the controls
0
 
LVL 15

Expert Comment

by:lakshman_ce
ID: 17139926
Add Static Text control
Right click the static text control and click Properties
You would see a dialog showing the ID of static control and the Caption as 'Static'
You can change the caption to 'Red'

0
 

Author Comment

by:yunikon
ID: 17140592
I'm aware of that.  The next two bulleted paragraphs say to access View->ClassWizard.  When I choose Message Maps tab and under Object ID's, there's no ID for the Static controls, only  IDC_EDIT, IDC_SCROLLBAR1  etc.   So I cannot assign a variable name (using 'Member Variables' tab) to these controls (ID_STATIC) to use in the program.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 15

Assisted Solution

by:lakshman_ce
lakshman_ce earned 60 total points
ID: 17141356
They are just static labels and not controls. The tutorial doesn't specify that you should have member variable for these labels. Btw why you want them. Are you going to change the display from 'Red' to something else?

If you would like to change do like this

(GetDlgItem(IDC_STATIC1))->SetWindowText("OtherColor");

where IDC_STATIC1 is the control id
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
ID: 17142224
The actual text in the tutorial is:

>> ... Then add three horizontal scroll bars from the toolbox.
>> Select all and use the layout menu to make them the same size, align them and arrange
>> them evenly. Next, add three edit boxes beside them AND A LABEL across the top.
>> Arrange them neatly as shown...

>> ·  Right click EACH LABEL label to bring up the properties box and for each (under the styles tab),
>> align text:centre, centre vertically and give them a border. Give the top label the
>> caption Colour Changer and the other three Red, Green and Blue respectively. ...

The tutorial is inexactly worded, and it does not match the picture (e.g., "and a label acreoss the top).  However, it is clear that instructions are to ADD three Edit boxes and to also add three LABELs and to change the captions of the LABELs.

-- Dan
0
 

Author Comment

by:yunikon
ID: 17143612
Thanks for that clarification Dan.  
The tutorial has -

n_red = 1;  //Declare and initialize three integer vari..
n_green = 1;
n_blue = 1;

- When I build this error results -  'The n_red, n_green and n_blue variables have not been declared.'

Declared them in  .......Dlg.h and code works.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question