I want to communicate between c# and c++. Can somebody tell me what is the best approach for this?
I want something like I have a c# dll which exposes some methods. I want to consume those methods in the COM client.(c++) which means source is c# dll and client is c++.
I am facing issues with CoCreateInstance. The program is compiling fine. The problem with cocreateinstance() giving an error like hr "the System cannot find the file specified" I registered the .tlb file to registry editor also but i am not able to fix the
problem. Can you give a fix for my problem.?
Thanks. we are now able to communicate with c# and COM with c# assembly with no dependent assemblies.
But, i have some issues with the dependency assemblies. I have c# assembly that have the dependency assemblies, when i am trying to register the assembly for the .tlb file, i am facing the problem like "RegAsm : error RA0000 : Could not load file or assembly.The
System cannot find the file specified.
Any idea on this?
Marked as answer by shanenarri on Jun 30, 2010 11:51 AM
shanenarri
Member
2 Points
26 Posts
c# Interoperability
May 31, 2010 04:57 AM|LINK
Hi Friends,
I want to communicate between c# and c++. Can somebody tell me what is the best approach for this?
I want something like I have a c# dll which exposes some methods. I want to consume those methods in the COM client.(c++) which means source is c# dll and client is c++.
Give a good sample on this requirement friends.
Thanks,
Shanenarrifield.
ignatandrei
All-Star
134832 Points
21599 Posts
Moderator
MVP
Re: c# Interoperability
May 31, 2010 07:33 AM|LINK
read tutorial here
http://msdn.microsoft.com/en-us/library/zsfww439.aspx
and be attentive at CoCreateInstance
shanenarri
Member
2 Points
26 Posts
Re: c# Interoperability
Jun 01, 2010 08:20 AM|LINK
Hi,
I have gone throught the tutorial what has mentioned. I did a sample for interoperability using http://msdn.microsoft.com/en-us/library/aa645738(vs.71).aspx .
I am facing issues with CoCreateInstance. The program is compiling fine. The problem with cocreateinstance() giving an error like hr "the System cannot find the file specified" I registered the .tlb file to registry editor also but i am not able to fix the problem. Can you give a fix for my problem.?
ignatandrei
All-Star
134832 Points
21599 Posts
Moderator
MVP
Re: c# Interoperability
Jun 01, 2010 08:40 AM|LINK
look into the registry for the guid. Did you find there ?
If yes, then check if the path is ok
If not, register a new time with regasm
shanenarri
Member
2 Points
26 Posts
Re: c# Interoperability
Jun 02, 2010 09:33 AM|LINK
Hi,
Thanks. we are now able to communicate with c# and COM with c# assembly with no dependent assemblies.
But, i have some issues with the dependency assemblies. I have c# assembly that have the dependency assemblies, when i am trying to register the assembly for the .tlb file, i am facing the problem like "RegAsm : error RA0000 : Could not load file or assembly.The System cannot find the file specified.
Any idea on this?