Article ID: 125242
Article Last Modified on 8/16/2005
TESTCTRL.MAK -- 16-bit Project File
TESTCT32.MAK -- 32-bit Project File
nmake WIN32=1 // 32 bit version nmake WIN32=0 // 16 bit versionWithin the generated source files, place platform-dependent code in conditional compilation blocks, as shown in this example:
LRESULT CTestCtrl::OnOcmCommand(WPARAM wParam, LPARAM lParam)
{
#ifdef _WIN32
WORD wNotifyCode = HIWORD(wParam);
#else
WORD wNotifyCode = HIWORD(lParam);
#endif
// TODO: Switch on wNotifyCode here.
return 0;
}
To maintain platform independence, use conditional compilation blocks
to isolate platform dependencies in the code you add to your control.
Use the #error statement to flag features that are not implemented
for one platform or the other. For example, you might code the previous
example like the following if the 32-bit implementation was not complete:
LRESULT CTestCtrl::OnOcmCommand(WPARAM wParam, LPARAM lParam)
{
#ifdef _WIN32
#error OnOcmCommand parameter decoding not completed for Win32!
#else
WORD wNotifyCode = HIWORD(lParam);
#endif
// TODO: Switch on wNotifyCode here.
return 0;
}
Note that because separate project files are used for 16- and 32-bit
targets, all project maintenance will need to be performed for both
projects. Project maintenance activities include:
Additional query words: kbinf 1.00 2.00 ole control portability
Keywords: KB125242