Need C++ Library in C# Class Library
-
Dear All, i have a Unmanaged c++ based Library and i want to use it C# application(i.e. it expose some c based function .. ).. could some one give some pointer to use unmanaged library in c#.. so that i don't have to provide some extra dll or lib with c# to my end user.... thanks in advance
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you
-
Dear All, i have a Unmanaged c++ based Library and i want to use it C# application(i.e. it expose some c based function .. ).. could some one give some pointer to use unmanaged library in c#.. so that i don't have to provide some extra dll or lib with c# to my end user.... thanks in advance
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you
ThatsAlok wrote:
so that i don't have to provide some extra dll
It doesn't work that way, you will still need to include the C++ dll.
only two letters away from being an asset
-
ThatsAlok wrote:
so that i don't have to provide some extra dll
It doesn't work that way, you will still need to include the C++ dll.
only two letters away from being an asset
Mark Nischalke wrote:
t doesn't work that way, you will still need to include the C++ dll.
i have C++ Library and related Header file.. now if get some pointer to proceed .. that will be great help from your side :).. i am little confused how to call these function in c#...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you
-
Mark Nischalke wrote:
t doesn't work that way, you will still need to include the C++ dll.
i have C++ Library and related Header file.. now if get some pointer to proceed .. that will be great help from your side :).. i am little confused how to call these function in c#...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you
-
Mark Nischalke wrote:
Using Unmanaged code and assembler in C#[^]
thats a great article...! sorry if i sounding like child.. could i use to DLLimport to import my ABC.lib.. or i have to use some other method!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you
-
Mark Nischalke wrote:
Using Unmanaged code and assembler in C#[^]
thats a great article...! sorry if i sounding like child.. could i use to DLLimport to import my ABC.lib.. or i have to use some other method!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you
DllImport
only works with unmanaged DLLs. An unmanaged static library (LIB) can't be used this way from C#. Only C++/CLI can mix managed and unmanaged code. As far as I can see you have 4 options: - Take the sources and convert them to C#. - Change the unmanaged project to build a DLL and then useDllImport
. - Create a mixed mode (managed - unmanaged) wrapper DLL in C++/CLI. - Write the client application in C++/CLI.Regards, Tim