Help on .NET Assemblies

  • Thread starter Thread starter Gideon
  • Start date Start date
G

Gideon

hi all.
i try to compile c++ code into a .NET assembly that would be integrated into
C#.
all my c++ types and objects are not __gc, so in the assembly they all seem
to inherit from System.ValueType; in the object browser, the members of my
c++ classes do not show, hence when i instantiate an object of that
assembly, i cant access any of its members.
can this be done at all without having my types being __gc?

also, after adding the dll as a reference, i get this error:
(i obviously did add it as a reference, etc.)

The type or namespace name 'NonManagedAssembly' could not be found (are you
missing a using directive or an assembly reference?)

thanks very much.
 
__gc is for .NET types and to be visible by .NET.
Without __gc you can't expose your classes. Wrap them in __gc classes
 
why not compile ur c++ code into a native dll,and use them like
[DllImport("user32.dll", EntryPoint="MessageBoxA")]
public static extern int MsgBox(int hWnd, String text, String caption,
uint type);
 
Back
Top