I am trying to use CPropertyPages and CPropertySheets in a DLL. At run time, in the DoModal event of the Sheet, the array of pages is built with BuildPropPageArray but when this calls PreProcessPageTemplate an assert fails because it has failed to LockResource for the page template.

I have tried using other pages and calling afxCurrentInstanceHandle = AfxFindResourceHandle(...) with no effect.

Any Ideas ???