how to use vc# dll into vc++ project

  • Thread starter Thread starter Kanaiya
  • Start date Start date
HI Kanaiya,

Is the VC++ project, a managed extensions project or
an unmanaged VC++ project ?.
For the former, you can use the #using directive to reference any
managed assemblies.
#using <MyCsharpAssembly.dll>
For the latter, you can expose your managed types via COM Interop
(generate a tlb via Regasm/tlbexp), and then consume the typelibrary
from your unmanaged VC++ COM-aware client.

Regards,
Aravind C
 
Hi

I was trying to use my C# DLL inside my Visual c++ Project. I followed your instruction with #using <mydll.dll>

However, it reports ..
c:\Win32TestProg.cpp(5): fatal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' optio

Please advice

Thank

----- Aravind C wrote: ----

HI Kanaiya

Is the VC++ project, a managed extensions project o
an unmanaged VC++ project ?
For the former, you can use the #using directive to reference an
managed assemblies
#using <MyCsharpAssembly.dll
For the latter, you can expose your managed types via COM Intero
(generate a tlb via Regasm/tlbexp), and then consume the typelibrar
from your unmanaged VC++ COM-aware client

Regards
Aravind
 
Are you trying to compile a clr compliant executable with your VC++ project
or not?

Paul said:
Hi,

I was trying to use my C# DLL inside my Visual c++ Project. I followed
 
Back
Top