CWinFormsDialog does not work as described - bug??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

VS2005 SP1:

CWinFormsDialog is an MFC class that is intended to allow an VC++/MFC -
based program to host a C# Windows Forms window as a dialog box.

Online help says about the CWinFormsDialog::OnInitDialog() method :

"It creates an instance of a UserControl control on the dialog box and
adjusts the size of the dialog box to accommodate for the size of the user
control. Then it hosts the new control in the MFC dialog box.".

Although the C# Windows Forms window does appear in the CWinFormsDialog
dialog at run time, the dialog window does not get resized. Instead, a small
dialog box appears with the Windows Forms window within it severely truncated.

The problem is easily demonstrated by implementing the example described in
the MSDN Library under the following path:

"Development Tools and Languages->Visual Studio->Visual C++->Programming
Guide->Native and .NET Interoperability->Using a Windows Form User Control in
MFC->Hosting a Windows Form User Control as an MFC Dialog Box"

Does anyone have a fix or workaround for this?

Thanks,
Jim
 
there is one thing for sure .... mfc is shipped with source code ... you may
always take a look into that and make your own class ... and yes bug free :)
 
Back
Top