CoBuildVersion
DWORD CoBuildVersion(void)
Return the major and the minor version number of the Component Object Model library.
Argument | Type | Description |
return value | DWORD | A 32 bit value whose high-order 16 bits are the major version number (rmm) and whose low-order 16 bits are the minor version number (rup). |
An application or .DLL can run against only one major version of the COM Library but can run against any minor version (possibly disabling specific minor features that are not available in a builds before a given minor number). Therefore during startup (initialization for .DLLs), all COM applications must include code similar to the following:
DWORD dwBuildVersion;
dwBuildVersion=CoBuildVersion();
if (HIWORD(dwBuildVersion)!=rmm)
//Error: Can't run against wrong major version
if (LOWORD(dwBuildVersion) < rup)
//Disable features dependent on the rup version of COM (or simply fail)
//Continue initialization