Define attributes in method parameters in F# -


I am importing DLL in a FL and then passing some parameters for some method.

  [& lt; DllImport ( "Winspool.drv", EntryPoint = "OpenPrinterA", SetLastError = true, charset = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall) & gt;] exile bool OpenPrinter ([& LT; MarshalAs ( UnmanagedType.LPStr) & gt ;.] szPrinter)  

parameter with the characteristics also have a name should receive answer compilers

it like we should have a MarshalAs feature first method in C #

  [DllImport ( "Winspool.drv", EntryPoint = "OpenPrinterA" ,, SetLastError = true, charset = CharSet .Ansi, ExactSpelling = True, CallingConvention = CallingConvention.StdCall)] Private Stable Execution bool OpenPrinter ([MarshallAs (UnmanagedTy Pe.LPStr)] string szPrinter;  

OpenPrinter parameter String szPrinter is called [UnmanagedType.LPStr MarshalAs (], but it's a feature is )

F # does not accept C # in such a way how to define characteristics within the method parameters?

That's because your extern is expecting a type of function parameter:

  exile bool OpenPrinter ([& LT; MarshalAs (UnmanagedType.LPStr) & gt;] string szPrinter)  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -