DrawText() does not work properly in Release build

Title: Release version of a 32-bit Win app fails to render text properly

Background:
I am running 64-bit Win 7 OS.
I have been developing Win apps in MS 2010 C++ Express for about 2 years now and have not until recently encountered any issues related to performance differences between Debug and Release builds.

Problem Description:
I have recently begun to develop a pair of 32-bit Win apps that use custom fonts. The issue before me is that, in the Release build of each app, some (but not all) calls to DrawText() fail to render text properly. Either the text does not render at all, or the text is rendered with the wrong font. This problem is fully repeatable -- the same calls malfunction in the same way each time the app is run.

The Debug builds of each app do not exhibit this problem.

For each build version, no errors are encountered during build, and no run-time errors are reported. The appearance of the app window created by the Release build is simply different from that created by the Debug build.

App construction:
Under WM_CREATE in each app, I use

GetSystemInfo(&SystemInfo);
dweeb = SystemInfo.dwPageSize*int(8+ceil((2.0*sizeof(*CategorySRC)
+sizeof(*Question))/ SystemInfo.dwPageSize));
hHeap = HeapCreate(0L,2*dweeb,3*dweeb);

to allocate approximately 1.5 X the max heap space I believe is needed.
Also under WM_CREATE, I use function CreateFontIndirect() to create 4 dirrerent custom fonts -- a script font and 3 Ariel fonts of various sizes. I save the HFONT handles as static HFONT in WndProc(). ( I have also tried preserving them as global vars -- no difference in results.)

What I have done to resolve this on my own:
(1) Lots of research on MSDN and other websites, including these:
(a) http://msdn.microsoft.com/en-us/library/dykf6bx9(v=vs.100).aspx
(b) http://msdn.microsoft.com/en-us/library/fsk896zz(v=vs.100).aspx
(2) Configured MS C++ Express IDE per guidance from http://msdn.microsoft.com/en-us/library/fsk896zz(v=vs.100).aspx
(3) Lots of experimentation.

To All:
Please advise what additional info you would find useful.
I can provide upon request
(1) Screen shots of the window produced by each app version.
(2) Samples of relevant code.
(3) Diagnostic output -- i.e., ASCII file listing data items relevant to DrawText prior to each call.
Please also advise how and where I could post this information.
Thank you in advance for your assistance.

rwh
Last edited on
Topic archived. No new replies allowed.