Managing lo-dpi and hi-dpi resources in one app

When you are writing one application that can run at either lo-dpi or hi-dpi (as I hope you all are to take advantage of the new hardware that'll be coming out), there is the issues of how to manage the two sets of image resources.  One technique that works well is to put your image resources into two “satellite“ DLLs.  For example, you'd have myres96.dll and myres192.dll.  Then at install time, you simply delete the satellite DLL that doesn't correspond to the DPI of the device, and rename the other one.  For example, delete myres96.dll and rename myres192.dll to myres.dll. 

There is a sample in the Developer Resource Kit (called “ResDLL“) that illustrates how to do this.  Unfortunately, due to a change in the product code after the sample was written, there is a bug in the sample.  Here is the corrected version:


[Author: Jason Fuller]

Comments (2)

  1. Jerry Pisk says:

    You delete the onse you don’t need? That might make sense on a portable device which is going to stay as is but not on a regular desktop, where the user might upgrade/downgrade his or her display at any time. And having to reinstall an app just because of that wouldn’t be funny.

  2. Jason says:

    Jerry, this blog is only about portable devices using Windows Mobile. A regular desktop computer is a different issue.

Skip to main content