April 2002
Beginner
413 pages
10h 46m
English
If you looked at the DisplayTime function shown in Listing 22.2, you ran across a few items that haven't been discussed yet. As mentioned earlier, the common language runtime will use data types that are compatible with one another when marshaling data between managed and unmanaged code. However, the String object can be represented by several different native C data types. If you need to call a function contained within an unmanaged DLL that contains different data types the String object could represent, you must use the MarshalAs attribute when creating the function definition. An example of one of these functions is the MultiByteToWideChar function, which is used to convert a single- or multibyte ...
Read now
Unlock full access