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.
Related
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.
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
Once I needed to modify a variable that was inside another application in order to modify its behavior.
I wonder whether its possibile to create an application that will get access to another process running on the same computer and modify some variable value. Process is a native one, and the application is written in c++. Do you know some good tutorials that help to achieve this?
I think you are looking for WriteProcessMemory function, take a look on this
You can use shared memory for this but this is more of an advanced concept: How to implement shared memory in .NET?
You can have a look at other alternatives: Passing data between C++ (MFC) app and C#
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.