Returning allocated structure from C

BlitzMax Forums/BlitzMax Programming/Returning allocated structure from C

BlitzMax object is not a C struct - it has an object pointer and a virtual function table much like a C++ struct/class can have.


That's not true for types declared inside an extern block. When BlitzMax was first born these did use to associate directly with C structs, unfortunately on win32 I think they got broken when the com IUnknown interface feature was added. Easiest solution I think is to add a dummy int to the beginning of your C struct declaration (but not your blitzmax extern type definition).