Wrapping this Method for BMax

BlitzMax Forums/BlitzMax Programming/Wrapping this Method for BMax

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.

Ok, Here's a Method I have wrapped for BlitzMax, which I believe I have wrapped incorrectly.

c++
extern "C" __cdecl cTV_3DVECTOR CTVPhysics_GetBodyPosition(CTVPhysics* Ha,int rigidBodyIndex) {
	return Ha->GetBodyPosition(rigidBodyIndex);
}


bmx
Function CTVPhysics_GetBodyPosition:Byte Ptr(Ha:Byte Ptr,rigidBodyIndex:Int)


I'm getting an unhandled memory exception on it though. I know that Ha->GetBodyPosition returns a cTV_3DVECTOR, that's correct. But normally when I get objects back from my C++ wrapped functions, get them back as Blah* not just Blah. Could this be the problem? If so, what can I do? I can't just change the return type of the C++ function to cTV_3DVECTOR* because it complains that the function return type does not match ( because, as I said, Ha->GetBodyPosition returns a cTV_3DVECTOR, not a cTV_3DVECTOR*