Solved

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

Posted on 2006-07-19
6
222 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

947 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now