Re: MFC and c++ problems

Tech-Archive recommends: Speed Up your PC by fixing your registry



>Basically, my question is, how can I call A.method from B?  How can I
>change A.m_sStringVariable from B?  I have no problems doing this from
>A to B, as there is an instance of B in A....but vice versa?

Create a constructor of B which takes Class A as its parameter. B can
then call methods on Class A to do whatever.

Another way is to use GetParent() from Class B. Since its a child
control of Class A. You can use dynamic_cast on it to get Class A. Keep
in mind that dynamic_cast may hinder your performance if this is
something you are doing very often, it could be a problem.

-------
Ajay Kalra
ajaykalra@xxxxxxxxx

.



Relevant Pages

  • Re: how to serialize control with View/Doc?
    ... > While it may be possible, it would be bad practice I think for the ... > when saving or set data to the control when reading from a file. ... Keep in mind that its really the view which knows when and if the data has ... Ajay Kalra ...
    (microsoft.public.vc.mfc)
  • Re: Interpol "configured to reject your mail" re Paul Gieschen (Heropoules/Vensel)
    ... Most republicons have so little mind, that control is basic and simple, just ... for the government and was equipped with a spray to put a sleeping ... wonder what else is sacred these people might torture. ...
    (soc.retirement)
  • The Doors Of Perception: Why Americans Will Believe Almost Anything
    ... invisible government which is the true ruling power of our country. ... This is a logical result of the way in which our democratic society is ... pull the wires that control the public mind." ... of media control arose historically, the reader might be more apt to ...
    (sci.med)
  • Re: Another reason why genocide is the answer...
    ... Gee, just who is that we control over there, would you ... > a nice uninteruppted weapons flow. ... Never mind the fact that the odds are ... If middle east didn't have oil, 99.99% of all americans including the people ...
    (rec.sport.paintball)
  • Re: HAARP: Is Mind located in Tsunami Wave Function?
    ... The speculations about HAARP mass mind control cannot be far ... > This control is at its worse around the globe right here in the USA. ... and any other form of technology which uses electromagnetic transfer, ... Another web site devoted to synthetic telepathy and subliminal, ...
    (sci.physics)