Class Pointer Size in C++

Blitz3D Forums/Blitz3D Userlibs/Class Pointer Size in C++

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

here something for you to note kurix, yes a pointer is 4bytes but if you plan on using the dll with blitz heres a trick.

/* in c++ */
KURI_API class1* _stdcall myfunction()
{
}

; in blitz decl file
myfunction%() :"myfunction@4"

the idea is not to run a conversion like "return long(instance1) " just just return the pointer itself because its an integer. what this does is speed up the function. when the pointer is returned to blitz its returned as an integer. just pass the same integer to any other function to the dll and make sure the dll recieves the integer as a pointer.

do you understand?