Start with the project you created in Implementing the Container - Initializing, Creating and Freeing.
Add the following code to the WndProc function before the InvalidateRect
function in the "case IDM_FILE_OPEN:" statement:
{ // CONTAINER METRICS
CONTAINERMETRICS Metrics;
Metrics.nSize = sizeof(CONTAINERMETRICS);
Metrics.dwMask = CMF_LIMITS | CMF_PALETTE;
Metrics.hPalette = hPalette;
SetRect(&Metrics.rcLimits, 0, 0, BITMAPWIDTH(&hBitmap), BITMAPHEIGHT(&hBitmap));
L_ContainerSetMetrics(pContainer, &Metrics);
} // CONTAINER METRICS
Compile and run the project by selecting Build->Rebuild Solution from the menu, and then Debug->Start Without Debugging.