Saturday, December 27, 2008

MSDN Deployment forum

In the MFC 6 installer, it was easy to register a DirectShow filter ( you added a COM object in Associations view, specified the CLSID, and if you also specified Context = vsiccInProcServer32 and DefInProcType = emdhServer, a wonderful thing happened: if the filter was already registered by a different application, the new installation would increment a reference count somewhere, so that uninstalling the new application wouldn't remove the filter. Very cool.

I can't figure out how to make this happen in the 2005/2008 .NET installer. The Associations view is gone, replaced by the File Types editor, which doesn't do COM objects, just file associations. The only way I've found to install a DirectShow filter at all is by using Register = vsdrfCOMSelfReg, but this approach doesn't handle sharing: uninstalling the application removes the filter unconditionally, even if previously installed applications depend on it. I tried setting SharedLegacyFile = True but it didn't work. Not good! What to do?

Tuesday, December 16, 2008

restoring app also restores iconic tool dialogs

void CToolDlg::OnShowWindow(BOOL bShow, UINT nStatus)
// When an iconic app is restored, by default any iconic modeless dialogs
// it owns are also restored. Clobbering their iconic states clutters the
// screen, and violates the expectation that a restored app should appear
// just as it did when it was minimized. The workaround is to skip CWnd's
// behavior in this case, and rely on the main frame to hide and show any
// iconic modeless dialogs.
if (nStatus && IsIconic()) // if parent opening/closing and we're iconic
return; // do nothing
CPersistDlg::OnShowWindow(bShow, nStatus);


restoring minimized window position

In CPersist::LoadWnd, before SetWindowPlacement, add:

if (!(Options & NO_MINIMIZE))

Possibly the reason this isn't enabled by default is because if the screen resolution is reduced after exiting the application, the next time the application runs, minimized windows that would otherwise be off-screen are moved to the top left corner of the screen.

Saturday, December 13, 2008


Alpha version: deep zoom render that normally takes 1546 secs on CHRISK took 41 secs using the standard list of 24 Z machines, a factor of 37.7 times faster.

Compression: would help but only a little, typical ratios using pkzip were between 50% and 70%.