i´ve downloaded bacnet-stack http://sourceforge.net/projects/bacnet/ written in c , want use in c#.
i´ve been reading 4 hours how done i´m not further. answers write code anew in c# have no clue of c . opened workspace in code::blocks code , compiled library a.-file. how can use it?
greetings,
stefan
to address alike situation, microsoft provides attributes, assembly, , marshaling offer interoperability between managed-unmanaged code(not .net aware/running outside clr boundaries) , managed-legacy com.
investigate use of dynamics , (dynamic language runtime- dlr) should more fine.
code example (using kernel32.dll) example of calling unmanaged code managed context
[dllimport("kernel32.dll", entrypoint="movefile", exactspelling=false, charset=charset.unicode, setlasterror=true)] static extern bool movefile(string sourcefile, string destinationfile); //calling function static void main() { movefile("sheet.xls", @"c:\sheet.xls"); } check pdf also: http://www.nag.com/industryarticles/calling_c_library_dlls_from_c_sharp.pdf
Comments
Post a Comment