-
February 8th, 2008, 12:45 PM
#1
Using C++ code in a C# project.
I have a curve fitting algorithm in templated C++ and I want to use it in my C# project.
I need to figure out what I need to do to use this code without translating it into C#.
I'm told I could make a component out of it, but I don't know how.
I was told something about 'unsafe' code... don't know how...
Help?
-
February 8th, 2008, 01:51 PM
#2
Re: Using C++ code in a C# project.
Create a DLL project in C++ that contains your method(s).
Use DLLImport to call your methods from your C# code.
Example here:
http://www.codeguru.com/csharp/cshar...cle.php/c4217/
-
February 8th, 2008, 02:12 PM
#3
Re: Using C++ code in a C# project.
Ok thats a good starting point.
I need to pass an array of floats to the dll and I'm really not sure what C# is passing and what C++ is receiving...
-
February 11th, 2008, 09:32 AM
#4
Re: Using C++ code in a C# project.
If the algorithm really complicated? If not, why not just re-write it in C#?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|