I've been using a lot of <DllImports> as of late and i was wondering if
anyone could tell me a good tutorial/website/articles/books
that explains what System.Marshal* * actually does and how to make those
structures that some windows api methods need passed in/out.
So far i've used mostly methods that send in/out strings, bool, integer and
so on, easy to convert into CLR types, but some methods need structures and
some of these have quite some exotic <parameters> set. How do people know
when that is needed to be set is a mystery to me (i would like to learn it).
Example:
<StructLayout(L ayoutKind.Seque ntial)> _
Public Structure StartUpInfo
Public cb As Integer
<MarshalAs(Unma nagedType.LPTSt r)> Public lpReserved As String
<MarshalAs(Unma nagedType.LPTSt r)> Public lpDesktop As String
....
this article was great:
http://msdn.microsoft.com/library/de...07/NET/toc.asp