size_t, void* and hbitmap data type equivalents in MIDL
What MIDL data types should I use to declare interface method parameters of C++ data types like size_t
, void*
, 开发者_开发问答HBITMAP
and other types of winapi handles (HANDLE
, HFONT
, etc.)?
size_t
is implementation defined, but using Visual Studio's CRT, it's an unsigned 32-bit integer when compiling for 32-bit architectures and an unsigned 64-bit integer when compiling for 64-bit architectures. You'll want to use unsigned __int3264
, which is 32 bits on a 32-bit architecture and 64 bits on a 64-bit architecture.
void*
is another platform dependent type. MIDL provides a void*
type, but it's only a 32-bit pointer regardless of the targeted address size, I believe. You may want to use the unsigned __int3264
type, instead.
MIDL provides types with the same names as the various handle type, though I'm not sure if all handle types are included; I know HBITMAP
is, at least.
精彩评论