Re: MDI forms and Dlls (visual C++ 2005) by Alex
Alex
Sun Jul 23 03:14:38 CDT 2006
"Fisherking" wrote:
> Okey, Nobody?
>
> hmm. I have almost made it but there is one problem.
>
> I can get the parent form and all it classes, but I cant
> cast the Form
> I recieve to a MainForm (as my parent form is called). And
> if I try I
> to #include "MainForm.h" I create a circular dependency
> and we all know
> that C++ does not allow this (without workarounds)
>
> I dont have access to the code right now, but I have
> tried something
> like this:
> safe_cast<MainForm ^ >(this->MdiParent);
>
> But the compiler does not know about the MainForm class!
It seems that you're working with WinForms or whatever .NET
framework for GUI. This group is not the best choice for
such kind of questions, since most of participants are
proficient in C++ rather than .NET languages and
technologies.
Anyway, I can give you an answer from Win32 point of view.
It may be OK for WinForms and it may be totally wrong, I'm
not a big expert in WinForms framework.
In Win32 world "communication" between windows boils down to
posting/sending messages to them. So, all you need to
communicate successfully between MDI children is their
HWND's. You can register each MDI child with parent window
and from any other MDI child request window handle and post
or send user defined message.
Also, try to ask in following groups:
microsoft.public.dotnet.framework.windowsforms
microsoft.public.dotnet.languages.vc
HTH
Alex