如何向/从此函数指针传递或获取参数值:
typedef void(* CreateCursorBitmapProc )(uchar *bitmapBuffer, uint32 *width, uint32 *height, bool16 *hasAlpha)
bitmapBuffer,width,height,hasalpha是out参数。
答案 0 :(得分:2)
// Grab an instance from somewhere...
CreateCursorBitmapProc instance = ...;
// Declare output variables
// should be initialized to some buffer, probably
uchar *bitmapBuffer = new uchar[size_of_buffer];
uint32 width, height;
bool16 hasAlpha;
(*instance)(bitmapBuffer, &width, &height, &hasAlpha);