Quantcast
Viewing all articles
Browse latest Browse all 12583

Use a COM component in Visual C++ 6

I’ve got a COM control being developed in C# and have trouble using it in my Visual C++ 6 application. I thought I would need a handle of the control and assign it to my form, but not sure if I’m going in the right direction. Is it the right approach? Could someone please help me use this control:

namespace MyControl
{
    [ComVisible(true)]
    [InterfaceType(ComInterfaceType.InterfaceIsDual)]
    [Guid("C8BDB590-189D-4EB5-A026-7C9FFBEE3111")]
    public interface InterfaceMain
    {
        [DispId(1)]
        void Show(string myString);
    }

    [Guid("301EC2A7-EB40-45BC-962E-E7DE21237FBA")]
    [ClassInterface(ClassInterfaceType.None), ComVisible(true)]
    public partial class Main : UserControl, InterfaceMain
    {
        [ComVisible(true)]
        public void Show(string myString)
        {
            txtLabel.Text = myString;
        }
    }
}

In Visual C++ 6:

CMDIChildWnd* m_pMyForm = new CMDIChildWnd; m_pMyForm ->LoadFrame(IDR_MAINFRAME,
WS_OVERLAPPEDWINDOW|WS_VISIBLE, this, 0);


What should I do next in Visual C++ 6?....?


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>