使用内部函数实现枚举类型宽度设置
使用内部函数实现枚举类型宽度设置
可以自由设置宽度了
void Utilities_InternalFunctionCast::setEnumBlockWidth(tag_t enumTag, int widthValue)
{
HMODULE uifw = LoadLibrary(INTERNAL_UIFWLIB);
HMODULE syss = LoadLibrary(INTERNAL_SYSSLIB);
typedef void* (*TagToPtr_fp_t)(tag_t);
typedef void(*setWidth_fp_t)(void*, int);
TagToPtr_fp_t TagToPtr = NULL;
setWidth_fp_t setWidth = NULL;
char* ptrName = "?TAG_ask_pointer_of_tag@@YAPEAXI@Z";
char* widthName = FUNCTIONNAME_SETENUMWIDTH;
TagToPtr = (TagToPtr_fp_t)GetProcAddress(syss, ptrName);
setWidth = (setWidth_fp_t)GetProcAddress(uifw, widthName);
if (TagToPtr != NULL && setWidth != NULL)
{
setWidth(TagToPtr(enumTag), widthValue);
}
FreeLibrary(uifw);
FreeLibrary(syss);
}
页:
[1]