开发者

size_t, void* and hbitmap data type equivalents in MIDL

开发者 https://www.devze.com 2023-04-06 12:32 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号