?
Solved

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

Posted on 2006-07-19
6
Medium Priority
?
241 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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 a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

850 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