PDA

View Full Version : declaring a friend



jayw710
18th April 2006, 04:19
Hi,
Is it possible to declare a friend class between two dialogs without having to subclass them?

Thanks for any help,
Jay

Honestmath
18th April 2006, 04:30
Good Evening (where I am),

I presume you wish to do this in Designer. In the Object Explorer, make sure you choose the dialog which is going to grant access. Go to the Members tab and down to 'Class Variables'.
Add a "new variable" in public or protected (I don't believe it matters) that looks something like this:

public:
friend class OtherDialogClass;where "friend class OtherDialogClass" is the variable name. This should work fine.

Cheers,

Math

jayw710
18th April 2006, 05:12
Thank you. Worked like a charm!

Jay