|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Good tutorial on Windows APIanyone 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(LayoutKind.Sequential)> _ Public Structure StartUpInfo Public cb As Integer <MarshalAs(UnmanagedType.LPTStr)> Public lpReserved As String <MarshalAs(UnmanagedType.LPTStr)> Public lpDesktop As String .... this article was great: http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/03/07/NET/toc.asp Good website for both C# and VB
http://www.pinvoke.net/ Show quoteHide quote "Jarod_24" <jarod***@hotmail.com> wrote in message news:43db3a4e$0$3737$6d36acad@titian.nntpserver.com... > 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(LayoutKind.Sequential)> _ > Public Structure StartUpInfo > Public cb As Integer > <MarshalAs(UnmanagedType.LPTStr)> Public lpReserved As String > <MarshalAs(UnmanagedType.LPTStr)> Public lpDesktop As String > ... > > > > this article was great: > http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/03/07/NET/toc.asp > >
Whats's the problem using a enum like this?
Is It Possible to Retrieve a List of Declared Variables? How to: Retrieving BuiltinDocumentProperties from Word Document setting datagrid column widths in code? Detect Concurrent Running Instances Inheritance and function issue late binding problem with option strict What happen to Find in Files in VS2005? Run from Server or Workstation FileDownload with WebBrowser Control - disable the Save? |
|||||||||||||||||||||||