|
This can not help me because I have to handle mouse events of 10 components
on my dialoge box
Trioum
|
|
|
|
|
trioum wrote: I have to handle mouse events of 10 components
on my dialoge box
Which contrasts with your initial "when I let mouse over the PictureBox only" comment. Make up your mind before asking for help.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Derive a class from the picture box using the ClassWizard. Then you can manage the messages.
- NS -
|
|
|
|
|
:->which book helps a lot for beginners in VC++
who is gud at C++
kp
|
|
|
|
|
if you said of your info about C++ was better and what do you want to know exactly?
|
|
|
|
|
One of the founder of C/C++ wrote some really good books: Bjarne Stroustrup.
He really deserves to be read.
Also O'Reilly has undstanding books in every way.
Greetings from Germany
|
|
|
|
|
KarstenK wrote: One of the founder of C/C++ wrote some really good books: Bjarne Stroustrup.
Dr. Stroustrup had nothing to do with C. Furthermore, he was not "one of the founders" of the language; he was the designer and original implementor of it.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
KarstenK wrote: "Stroustrup, in his own words, "invented C++..."
I never said he didn't.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
From where do you start?
Do you know programming but need to learn syntax and idioms of C++?
What language did you do before?
Are you just starting with programming as a whole?
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: Do you know programming but need to learn syntax and idioms of C++?
What language did you do before?
Are you just starting with programming as a whole
yes iam just starting with programming,
iam appointed as a trinee in VC++.
|
|
|
|
|
I am sorry, I only have books on C++ for someone who has at least *some* knowledge of programming.
That was where I started
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Mr.Jhwurmbach me also not bad at programming..
but iam placed here as a fresher.ido't have fullpledged knowledge in VC++,upto my syllabus i know some basix of VC++.that iam asking u 2 Suggest books for improving my programming skills...
i hope u suggest some gud books for me
regards,
kp
|
|
|
|
|
I used
Nicolai M. Josuttis,"Object oriented Programming in C++", Addison-Wesley
Nicolai M. Josuttis,"The C++ standard library", Addison-Wesley
Richard M. Jones, "Introduction to MFC-programming with Visual C++", Prentice Hall
These are when you know all the basics, but before you developed a personal style:
Scott Myers, "Effective C++", Addison-Wesley
Scott Myers, "More Effective C++", Addison-Wesley
Scott Myers, "Effective STL, Addison-Wesley
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
thanQ Mr.Jhwurmbach
I do't have any particular tutor in this org for VC++ and iam the only person who selected for VC++.
so i have 2 prepare my own.
anyway iam thankful 2 u for suggestions.
and if possible pls suggest me some techniqs for self preparation in VC++.feel free 2 mail me kp007in@rediff.com
thanQ sir,
kp
|
|
|
|
|
krishna Vuppala wrote: I do't have any particular tutor in this org for VC++ and iam the only person who selected for VC++.
please look at this section of codeproject. http://www.codeproject.com/cpp . plus take my suggestion, please don't use SMS style language here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
krishna Vuppala wrote: me also not bad at programming..
Which contrasts with your earlier "iam just starting with programming" comment. Books are designed for a particular demographic/audience. If you claim no knowledge of programming, you will get one set of suggestions. If you claim some knowledge of programming, you will get another set of suggestions.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have a base class with a virtual method, from this base there are multiple derived classes, but more than one needs to overide that virtual method.
class A{<br />
virtual void OnSth();<br />
}<br />
<br />
class B : public A<br />
{<br />
virtual void OnSth();<br />
}<br />
<br />
class C : public B<br />
{<br />
}<br />
<br />
class D : public C<br />
{<br />
virtual void OnSth();<br />
}
In the snippet above when class A calls OnSth() I need it to call the overide in both class B and class D . Everything I have tried only results in the class B 's method being called. What am I doing wrong?
Waldermort
|
|
|
|
|
WalderMort wrote: What am I doing wrong?
seems nothing.
Try to overide OnSth also in class C
void C::OnSth(){
B::OnSth();
}
Russell
|
|
|
|
|
WalderMort wrote: In the snippet above when class A calls OnSth() I need it to call the overide in both class B and class D.
I don't really understand that part of your question. Do you mean that when something outside your class calls the OnSth function, it should be redirected to D::OnSth (standard behavior of virtual functions) ?
Because if you call OnSth from inside class A, it cannot call both B::OnSth and D::OnSth, it will only call the function in the most derived class.
|
|
|
|
|
Cedric Moonen wrote: it will only call the function in the most derived class
yes, and that's his problem... D's method should be executed, but it's actually the method from B class that is called.
|
|
|
|
|
The problem was that the derived method in class D was not being called and instead calling that of class B.
I realise only one method may be called, but in reality I need both methods in classes B and D to be called. I suppose the only way to do this is to call B::OnSth() explicitly from class D or to add a new virtual method in class B.
The type of behaviour I'm looking for is when class A, internally, calls DoSth(), then the code should call the method in class B THEN call the method in class D. Not exactly C++ standard I know.
As for the main problem, I fixed it.
Waldermort
|
|
|
|
|
Perhaps this could be a design issue...
Basic OO design gives that a child class is a specialization of the base class and inherits the behavior of the base class. It's like saying "a rectangle is a shape" and shape would be the base class of rectangle. I guess you already know this.
But the implication is that when you derive from a class you also derive its behavior, i.e. the implementation of a certain method in case it's declared as virtual.
Calling a base class implementation of a method is quite alright, it just means that you want the behavior of the base class and want to add a little something to it.
From my understanding you want to go the other way around, i.e. calling the child class implementation from the base class and this creates some problems. Not that they cannot be solved, but there's a possibility that you're trying to solve the problem using the wrong tool.
Perhaps it's the observer design pattern[^] you really need. It's the same pattern used in the doc/view architecture when the document notifies all views about a change in the document.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: Perhaps it's the observer design pattern[^] you really need
That sounds like exactly what I am looking for. I have several windows, each represented by a class, that display certain aspects of a main class. When something changes in the base class, one or more windows may need to update their content.
After quick glance at a few articles relating to the topic, it seems a little difficult to implement. Guess I have some reading to do.
Thanks for pointing out this, new to me, design pattern.
Waldermort
|
|
|
|
|
WalderMort wrote: I have several windows, each represented by a class, that display certain aspects of a main class. When something changes in the base class, one or more windows may need to update their content.
Yep, that sounds like a school book situation for an observer pattern.
Perhaps you won't need to do a fully fledged implementation if you don't separate the data from the presentation: you could have a static list in the top-most class containing the "observers" and when the observers need to be notified you simply traverse the list calling the virtual "notify" method of each observer.
Just a thought... :->
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|