Using C# DLL in VC++ 6

  • Thread starter Thread starter llihp
  • Start date Start date
L

llihp

Hi all,

I'm trying to use a C# DLL in VC++ 6. From reading a few articles I have
read that it is possible by using COM. I have created a simple class in
C# and created a type library using tlbexp.exe and imported it in my C++
source code, but I can't work out how to use the objects from my class.

My C# class is simple:

public interface ISimpleClass {
int test(int a);
}

public class SimpleClass : ISimpleClass {
public SimpleClass() {
}

public int test(int a) {
return a;
}
}

Any hints/help would be highly appreciated. I'm going mad here! :)
 
Try

regasm /tlb youCSharpLib.dll

This will generate the TLB and do the COM registry entries.

Marcus Heege
 
Hi, thanks for the reply.

I've done that bit already, I'm having trouble working out how to
instantiate and make use of the object in VC++.


Marcus Heege said:
Try

regasm /tlb youCSharpLib.dll

This will generate the TLB and do the COM registry entries.

Marcus Heege



Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
 
Back
Top