unmanagedexports

Return List/Array from unmanaged C# DLL

拈花ヽ惹草 提交于 2019-12-31 07:13:07
问题 I have Unmanaged C# DLL: [DllExport(ExportName = "GetStudentsList", CallingConvention = CallingConvention.StdCall)] static public List<StudentsStruct>GetStudentsList() { return List<StudentsStruct>; } [DllExport(ExportName = "maxElement", CallingConvention = CallingConvention.StdCall)] static public int maxElement(int a, int b) { return c; } I want to return List<StudentsStruct> from the function. And I want to run above function in a C++ Application: using GetStudentsListFn = List

Form not displaying in credential provider

馋奶兔 提交于 2019-12-24 00:45:03
问题 I have a function in C# that displays a form. I have exposed the function using Unmanaged Exports and calling it from C++ in credential provider sample on a command link. The form does not display (nothing happens). However, when I call the same C# form using C++ console application, the form displays without any issue. What could be the difference that C++ console application is loading it but C++ credential provider code is not loading it? C++ Code: using CSharpForm = void(__stdcall *)

Returning a string from a C# DLL with Unmanaged Exports to Inno Setup script

心不动则不痛 提交于 2019-11-27 09:36:29
I have a C# DLL which exposes a function using Unmanaged Exports which is called directly by an Inno Setup Pascal script. This function needs to return a string to Inno Setup. My question is how can I accomplish this? My preferred method is to pass a buffer from Inno Setup to the C# function which will return the string inside this buffer. I've come up with this code: C# function: [DllExport("Test", CallingConvention = CallingConvention.StdCall)] static int Test([Out, MarshalAs(UnmanagedType.LPWStr)] out string strout) { strout = "teststr"; return strout.Length; } Inno Setup script: function

Returning a string from a C# DLL with Unmanaged Exports to Inno Setup script

ε祈祈猫儿з 提交于 2019-11-26 17:51:31
问题 I have a C# DLL which exposes a function using Unmanaged Exports which is called directly by an Inno Setup Pascal script. This function needs to return a string to Inno Setup. My question is how can I accomplish this? My preferred method is to pass a buffer from Inno Setup to the C# function which will return the string inside this buffer. I've come up with this code: C# function: [DllExport("Test", CallingConvention = CallingConvention.StdCall)] static int Test([Out, MarshalAs(UnmanagedType