How to call a Function in VC++ from C#?
-
Hi all, I'm new to .NET .I have A function which declared in VC++ like LONG GetData(VARIANT *varData) This function returns the data of type double through this varData variable. How could i call this function from C#? Thanks in advance?
Hi, Its better you create a DLL of your VC ++ class and call that DLL from your c# application using DLL Import atribute. and use that function . you will get lots of exaples of that in code project , just try to search it. Regards, Regards :rose:, Nishu
-
Hi all, I'm new to .NET .I have A function which declared in VC++ like LONG GetData(VARIANT *varData) This function returns the data of type double through this varData variable. How could i call this function from C#? Thanks in advance?
To call a C++ function from C#, you need to create a wrapper class in C# which uses C++ dll methods. Then call the C# method. You need to use
DllImport