April 2002
Beginner
413 pages
10h 46m
English
Most of the functions within the WIN32 API can easily be marshaled because their parameters have a similar managed data type. However, some functions may expect a struct as a parameter. To solve this, you must define a data structure within your source file whose members are equivalent to the data structure the DLL function expects to receive. To demonstrate this process, you will be using the WIN32 API function GetLocalTime, which expects a SYSTEM_TIME data structure as its only parameter. The process to do this is similar to creating the function definition.
When you define a structure that will be passed via P/Invoke, you need to be aware of two things. First of all, your structure or class must be a managed ...
Read now
Unlock full access