Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a native c++ dll which contains some templates classes. And I need this dll in my c# code.
So I am using managed c++ for the c++ dll in order to use it in the c# code, but I have a big problem on how using the template classes in .Net.
Please if you guys have some solutions to this, it will very helpful.
Thanks!
read C++ instantiate template class from DLL to make sure you're not falling down a common rabbit hole.
Read about IntPtr and Interoperability
Try putting it all together, and then post a new question which has a specific problem.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Given the fact that I need in specific parts of my projects,
to interop / interact a .net c# code with a code that's within a dll produced by an unmanaged language:
which language other than c\c++ has good compatibility and is as fast or preferably faster?
I have searched and found few ( looks promising) less popular names I couldn't decide on any of them as I have no clue how to if it's possible at all to interact with their dll.
Haskell, Rust, D, Fortran, Nim... and more..
Did you try to implement this approach with any of them?
Use C++/CLI. This give you an bridge with managed and unmanaged in the best performance possible.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have to write a C++ Dll to wrap an existing C++ Dll so it can be declared in C# because the existing C++ API is just too complicated (functions returning pointers to unions within structs within structs). Is there any best practice for this? For instance:
What's the best way of declaring a string from C++ to C#?
Is it better to have C++ functions using pointers or references?
It depends on how many functions you wish to export and if you wish to export them only to c#.
If you answer yes to one of these then I recommend using swig as functions will get generated for you automatically
Here is a link
http://www.swig.org/tutorial.html
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am working on a project where I need to use a wrapper written in C++ to transfer messages across servers through c# code. The client applications are written in c#, but the message bus that I have to use doesn't work directly with .NET, so C++ wrapper to the rescue.
I hope that this makes sense, and any help would be great. Thanks
You can call C++ contained in a dll from C# using Platform Invoke. http://msdn.microsoft.com/en-us/library/aa288468%28v=vs.71%29.aspx. In this case it is actually the C# code wrapping the C++ code.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i came across some Objective C code as follows
-(void)sChart:(ShinobiChart *)chart alterLabel:(UILabel *)label forDatapoint: (SChartDataPoint *)datapoint atSliceIndex:(int)index inRadialSeries:(SChartRadialSeries*)series// End
I want to convert it to C# for use in Xamarin. I havent been able to try as I dont know any objective C.
What would be the equivalent C# code?
thanks in advance.
You can't just grab and use an Objective-C library with Xamarin/C#. To use 3rd party native Objective-C code with Xamarin, you need to have bindings available for that library or you need to create bindings by yourself.
When creating binding you have luxury to decide how your C# equivalent code is going to look like. Though it should resemble original Objective-C library as much as possible while keeping in mind C# coding conventions and best practices.
Here is more info about creating Xamarin bindings for an Objective-C library.
http://docs.xamarin.com/guides/ios/advanced_topics/binding_objective-c/binding_objc_libs/
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
how to create a browser plug in using C#? (something like Flash Player or Unity3d)
This cannot be done using C# only.
WebKit is C++-based, so you'd need at least a C++ wrapper in order to let the browser communicate with your code. Using a mixed-mode C++ DLL that talks to WebKit on one side and to your C# code on the other side should be considered.
The WebKit site does not contain much docs (don't want to criticize, but I couldn't find much there when working with Chromium). Only Apple docs explain plug-ins, but it looks very Apple-oriented. Sorry, not very helpful.