Solved

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

Posted on 2006-07-19
6
219 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
Comment Utility
They mean the labels. ie. Static text from the controls
0
 
LVL 15

Expert Comment

by:lakshman_ce
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 15

Assisted Solution

by:lakshman_ce
lakshman_ce earned 60 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

9 Experts available now in Live!

Get 1:1 Help Now