c 23 p 2finvolke c 2b 2b dll get struct

Solutions on MaxInterview for c 23 p 2finvolke c 2b 2b dll get struct by the best coders in the world

showing results for - "c 23 p 2finvolke c 2b 2b dll get struct"
Bay
13 Apr 2019
1// At the dll wrapper class
2[DllImport(path, EntryPoint = "?GetParameters@@YGHKPAU_DevParam@@@Z")]
3public static extern bool GetParameters(int ID, IntPtr dParam);
4
5// At main
6int size = Marshal.SizeOf(typeof(DevParam));
7IntPtr Ptr = Marshal.AllocHGlobal(size);
8bool res = Class1.GetParameters(ID, Ptr);
9DevParam test = (DevParam)Marshal.PtrToStructure(Ptr, typeof(DevParam));
10
11// For testing purpoises, previously changed the default values with another method
12Console.WriteLine(test.Enable);
13
14Marshal.FreeHGlobal(Ptr);
similar questions
queries leading to this page
c 23 p 2finvolke c 2b 2b dll get struct