?
Solved

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

Posted on 2006-07-19
6
Medium Priority
?
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 
LVL 15

Assisted Solution

by:lakshman_ce
lakshman_ce earned 240 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 400 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

649 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