Click here to Skip to main content
16,010,334 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I am facing a problem, please help:

"There is a struct in C which i want to call/use in C#. The scenario is like i have a struct in C which has some data, which i need to use in a similar struct in C#.
The data of C struct should be transferred to C# structure."

Can anyone help me out with this and can write a code snippet for this..so that it will be more helpful.

You can explain with a small example..

Thank you,
Dinesh
Posted

Hi,
It is not very obvious actually. I guess you have a .dll in C++ which holds a struct and then you want to use the filled C++ struct in a C# program. Is that right?
 
Share this answer
 
Hi,
You must use DllImport in C# in order to use a .Dll which is created by C++.
here is a link:
http://www.dotnetperls.com/dllimport[^]

Cheers
 
Share this answer
 
Hi,

follow below links

1st link and 2nd link

this example shows how to use your c/c++ library in c# code. i think through that you can get you answer.

thanks
-Amit.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900