Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > Changing object properties
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 2nd October 14:51
francois trottier
External User
 
Posts: 1
Default Changing object properties



i know its a newbie question, but how can u change the properties of
an object ( for exemple the caption of a button) i know in vb you
could just write object.properties="" but how can we do that in c ++
  Reply With Quote


 


2 9th October 19:17
stefan höhne
External User
 
Posts: 1
Default Changing object properties



Hi,

giving examples should not make a posting off-topic, as
you suggest, David.

For the OP:

This depends.

In C++, an objects class, has a "public interface", that is all
stuff which is declared in the public:-section of the class.

Its quite unusual in C++ to give someone direct control
of class members. Its much more common to
define methods for performing all the operations we need.

So in C++ we often write something like

object.set_properties("");

or, for a class designed by a more literate programmer:

button.change_caption(std::string());

So ... look up the documentation of the class library you
are using. If you have questions about it, it will be better
to ask somewhere else (try Davids link for explanations).

For learning C++ its usually best to have a book. Look here
for reviews:

http://www.accu.org/bookreviews/public/index.htm

HTH,
Stefan.
  Reply With Quote
3 9th October 19:18
thomas matthews
External User
 
Posts: 1
Default Changing object properties


There is no rul that objets hav props in C ++ lang. objets, that
r instanses o' clases, hav members not props. Props usully r a 'piler
thingy n not part o' da lang.

If u must hav props, reed ur 'piler docs. C ++ is not like vb.

i no i can spel betr, but trend is not 2. I dont c y the O.P. isn't
consistent wit "u" n "you".

Maybe it's the rap culture thing.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
  Reply With Quote
4 9th October 19:20
david white
External User
 
Posts: 1
Default Changing object properties


[snip]

I don't see how you can tell from the OP's question that this was a question
about the C++ language and not about a specific definition of object
"properties" by a specific implementation for a specific GUI environment,
which it looks like to me.

DW
  Reply With Quote
5 18th October 03:49
deane_gavin
External User
 
Posts: 1
Default Changing object properties


You've a lot to learn about the rap culture thing Thomas - you're
still using capital letters and punctuation. ;-)

GJD
  Reply With Quote
6 18th October 03:49
stefan höhne
External User
 
Posts: 1
Default Changing object properties


Hi,

and I do'nt see the GUI environment specific details he gave.

I'll tend to allways assume the best.

Not every question which includes words like MFC is off-topic here.
The OP did not ask how to change the position of an MFC-object, he asked
about changing (arbitrary) properties of an (arbitrary) object.
Thats a C++-question.

Cheers,
Stefan.
  Reply With Quote
7 18th October 03:52
david white
External User
 
Posts: 1
Default Changing object properties


He mentioned 'button'. Surely that's a GUI button.


I agree. I have answered questions before from people posting very Windows
or MFC code that others thought were off-topic, but on inspection turned out
to be C++ language questions.


He didn't specifiy what he meant by 'object' or 'properties'. He could well
have been asking (and I thought he was) for the C++ equivalent of VB's
notion of properties of GUI objects in Windows, rather than general
properties of C++ objects.

Anyway, I didn't interpret the question the way you did but I concede on
reflection that it deserved a "please clarify" response rather than the
out-of-hand dismissal that I gave it.

DW
  Reply With Quote
Reply


Thread Tools
Display Modes




666