Using C# objects in MFC/C++

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wayne

    Using C# objects in MFC/C++

    How would you use a C# library(DLL) in an MFC application. I created
    the following mini library, however after using TlbExp to export the
    tlb I don't see how to invoke the Sample to DoSomething. I added the
    ..Tlb file to my MFC project but the public function is not available.
    Does anyone know what I did wrong?

    Thanks,
    Wayne
    -------
    using System;
    using System.Collecti ons.Generic;
    using System.Text;
    namespace Lib1
    {
    public class Sample
    {
    public void DoSomething()
    {
    System.Diagnost ics.Trace.Write ("COM invoked\n");
    }
    }
    }

Working...