拿这段代码:
WPARAM eTypes[] =
{
MAKEWPARAM(MSAToolsLibrary::AssignmentType_Sound, -1),
MAKEWPARAM(MSAToolsLibrary::AssignmentType_PlatformAttendant, -1),
MAKEWPARAM(MSAToolsLibrary::AssignmentType_Mike, -1),
MAKEWPARAM(MSAToolsLibrary::AssignmentType_Attendant, -1),
MAKEWPARAM(MSAToolsLibrary::AssignmentType_OCLM, -1),
MAKEWPARAM(MSAToolsLibrary::AssignmentType_ConductorCBS, -1),
MAKEWPARAM(MSAToolsLibrary::AssignmentType_ReaderCBS, -1),
MAKEWPARAM(MSAToolsLibrary::AssignmentType_Chairman, -1),
MAKEWPARAM(MSAToolsLibrary::AssignmentType_Prayer, -1),
MAKEWPARAM(MSAToolsLibrary::AssignmentType_Student, -1),
MAKEWPARAM(MSAToolsLibrary::AssignmentType_Demonstration, -1)
};
for (int a = 0; a < 11; a++)
{
WORD l = LOWORD(eTypes[a]);
WORD h = HIWORD(eTypes[a]);
CString s;
s.Format(_T("%d %d"), l, h);
AfxMessageBox(s);
}
AssignmentType
值为long
常量。
AfxMessageBox
产生65535,我知道它是整数的无符号值(我认为)。但我不想要值65535.我想要-1回(如果确实是-1)。它也可能是其他一些价值。
那么我该怎么做-1并且得到-1而不是65535回来?