Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Is there many methods can export C++ functions for C# to call?These C++ functions are defined in .h files or Static library(.lib).Thank you.
Posted

1 solution

Hello,

You are export functions directly from dll. How to make prototype of C++ DLL functions in C# properly described in that topic:

Consuming Unmanaged DLL functions[^]

Regards,
Maxim.
 
Share this answer
 
Comments
pucx 15-Oct-12 4:10am    
there are no dll files ,only have header files and static libraries.
Maxim Kartavenkov 15-Oct-12 4:19am    
You can build a dll using lib and export functions from that lib. But in C# you can access the dll functions or COM objects. One note for dll's and C# DLL should be compiled for same platform as target PC, or you should specify fixed platform in C# app settings and build DLL for it.

Maxim.
pucx 15-Oct-12 5:02am    
"build a dll using lib and export functions from that lib".I don't know how to achive this.thanks.
Maxim Kartavenkov 15-Oct-12 5:31am    
Create dll project in Visual Studio add your h file, create c or cpp file, make functions decalrations with exports and call in there your functions in h file, link with your lib file and build.

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