If you wanted to use MessageBox rather than the ANSI or Unicode functions, what changes need to be made to the DllImport attribute?
Change the CharSet attribute for DllImport to either Auto or remove it completely.
In an unmanaged class, are you responsible for freeing any memory that is allocated, regardless of the variable type?
No, managed types within the unmanaged class will still be garbage collected. You will, however, need to free any memory allocated for unmanaged member variables within that class.
If a DLL exports a C++ class that you wish to use within managed code, do you have to create definitions for each of the member functions within that class as well as the definition for the class?