Article : Using WinForms controls in an MFC dialog

After a long gap, I’ve written another article for The Code Project.

The article is a simple introduction to using the CWinFormsControl MFC class to put a Windows Forms control on an MFC dialog.


2 thoughts on “Article : Using WinForms controls in an MFC dialog

  1. Hi Nishant,
    Based on your example, I decided to try out MFC to .Net bridge and actually bought your book also. I have made some progress. However, I go stuck with the problem below for which I have not been able to find a solution. I have now bought your book on C++/CLI to seek further clues to the problem below. I will appreciate if you can provide further help.

    I have been testing out MFC to .NET connection. I have been through a number of hurdles. This one is
    beyond me.

    #pragma once

    using namespace System;
    using namespace System::ComponentModel;

    ref class CManagedClass1

    array^ MyArr;
    // default indexer
    property int default[int] {
    int get(int index) {
    return MyArr[index];
    void set(int index, int value) {
    MyArr[index] = value;

    bool bCanStretch;
    property Boolean CanStretch
    Boolean get() { return bCanStretch; }
    void set(Boolean value)
    bCanStretch = value;

    enum class suit{clubs,diamonds,spade,hearts};
    property suit MyPropertysuit
    void set( suit value )
    suit MyPropertysuit::get()
    // Getter code here:

    Out of 3 properties defined above, I do not know why property “MyArrFIX” DOES NOT WORK.
    Am I missing something here.
    Thanks in anticipation

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s