473,804 Members | 3,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CWinFormsDialog does not work as described - bug??

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:

"Developmen t Tools and Languages->Visual Studio->Visual C++->Programming
Guide->Native and .NET Interoperabilit y->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
Apr 2 '07 #1
1 1515
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 :)

"Jim Walsh" <Ji******@discu ssions.microsof t.comwrote in message
news:47******** *************** ***********@mic rosoft.com...
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:

"Developmen t Tools and Languages->Visual Studio->Visual C++->Programming
Guide->Native and .NET Interoperabilit y->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


Apr 2 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2054
by: Generic Usenet Account | last post by:
While I have a very good feel for how inlining works, I fail to see how in the world inlining can work if the inlined function is not described "in place" in a header file, but rather defined in a separate source file (using the inline keyword), which gets linked in? Does inling work at all in such cases? If it does, can someone kindly explain how the compilers handle that? If it does not, is that documented somewhere? Thanks, Gus
22
3087
by: Ryan M | last post by:
I've been programming for a while, but most of my experience is on unix. How do C compilers work on operating systems that weren't written in C? And that have no libc? Compiling C on unix seems so easy. Everything in the code either goes right to machine code, or links to a C library (often libc) or links to the kernel. Are there libc equivalents on non-unix OSes? -- Using M2, Opera's revolutionary e-mail client:...
9
8570
by: Frank Rizzo | last post by:
I understand the basic premise: when the object is out of scope or has been set to null (given that there are no funky finalizers), executing GC.Collect will clean up your resources. So I have a basic test. I read a bunch of data into a dataset by using a command and a data adapter object, .Dispose(ing) as I go. The moment the data is in the Dataset, the Mem Usage column in the Task Manager goes up by 50 MB (which is about right). I...
2
1235
by: Harry Whitehouse | last post by:
I just wanted to confirm this for WIN32 projects in VC++ 2003. It looks like you need to reference functions in 3rd party DLL's (C-based) by building a LIB file as described here: http://support.microsoft.com/default.aspx?scid=KB;EN-US;q131313&id=KB;EN-US;q131313 Am I wrong in my assumption? TIA
89
6090
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be used." Could anybody tell me why gets() function is dangerous?? Thank you very much. Cuthbert
4
9184
by: Jon | last post by:
Hi, I used XslCompiledTransform with the following Xsl file. The <xsl:text disable-output-escaping="yes"does not work when using XslCompiledTransform to do the trnasform (namely the output contain < not <), while it works when using MSXML2 to do the transform. Does anyone have the same problem and how to make the escape work? Thanks. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
1
1815
by: Aled Hughes | last post by:
Hi, I've discovered a stack-overflow crash scenario when using CWinformsDialog to show a managed UserControl as a dialog in MFC8. Basically all you have to do is press ESCape whilst the CWinFormsDialog is in the process of being shown. A stack overflow occurs and the stack trace shows that the MFC internal function "_AfxNextControl" is getting called continually. I've been able to easily recreate this behaviour in the "MFC04" sample
1
1521
by: =?Utf-8?B?SmltIFdhbHNo?= | last post by:
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.".
3
1308
by: =?Utf-8?B?SmFtZXM=?= | last post by:
What I'm basically trying to do is show one form from another when an event occurs. This is obviously straightforward in c#, but I'm struggling in c++ where each is wrapped in a CWinFormsDialog. The event is in the control in the CWinFormsDialog. I need the dialog to handle it and show the other CWinFormsDialog. I've created a custom event in the user control thats handled by its wrapping CWinFormsDialog. However when I try to call the...
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10588
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7623
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.