Sams Teach Yourself Visual C++.NET in 24 Hours

   

Q&A

Q1:

What does it mean when a data type is "blittable" or "non-blittable"?

A1:

A blittable type is a managed data type that has a common layout in memory in managed and unmanaged environments. In contrast, a non-blittable type has a different representation in memory when it's managed than it does when it is unmanaged.

Q2:

Some WIN32 API functions expect a pointer to a callback function. Can I create a callback function within my managed application?

A2:

Yes, you can, although the process is slightly different from creating a regular callback. Create the callback definition with managed types and prefix that definition with the __delegate keyword. You can then pass an instance of that delegate function as the function pointer to the WIN32 API function.


   
Top

Категории