On calling a function written in c from a dotnet c# application
-
HI, i ve written an application in dotnet c#(visual studio 2005) which requires to call a function written in c(this is part of other application). So please help me on how to call this function.
-
HI, i ve written an application in dotnet c#(visual studio 2005) which requires to call a function written in c(this is part of other application). So please help me on how to call this function.
your C function can be called as part of a dll using P/invoke. You have an app in C, not C++ ? It works the same way, anyhow, so long as it's in a dll. To call the function within a running app, you need to use WM_COPYDATA or something to set up interprocess communication.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
your C function can be called as part of a dll using P/invoke. You have an app in C, not C++ ? It works the same way, anyhow, so long as it's in a dll. To call the function within a running app, you need to use WM_COPYDATA or something to set up interprocess communication.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
hi, now i ve been able to call the function from the c# application. I made the dll and in the *.def file i ve exported this particular function. Then in my c# application using [dllimport(*.dll}], i called the function and i was successful in that, Now according to the c application as soon as this function is called it populates a structure with some values and ultimately i want these values. So now after successfully calling this function how can i get the structure values????Pls help