Article View: comp.windows.ms.programmer
Article #1015Modeless Dialogs vs Globals
From: Kevin P. Kleinfelter
Date: Mon, 07 Jan 1991 20:47
Date: Mon, 07 Jan 1991 20:47
27 lines
1278 bytes
1278 bytes
It appears that the dialog procedure for a modeless dialog cannot
access ANY global data. This would include literal strings, because
they go into the program's global data area.
For example,
MessageBox (NULL, (LPSTR) "Literal", NULL, MB_OK);
from within a modeless dialog procedure puts trash in the message box.
However,
foo [0] = 'O';
foo [1] = 'K';
foo [2] = 0;
MessageBox (NULL, (LPSTR) foo, NULL, MB_OK);
puts OK in a message box.
Am I correct in surmising that global data is inaccessable from a
modeless dialog, and that this includes literal strings?
Is this actually DOCUMENTED somewhere? Is it appropriate for a
programmer to have to know where his compiler puts literal strings?
--
Kevin Kleinfelter @ Dun and Bradstreet Software, Inc (404) 239-2347
{emory,gatech}!nanovx!msa3b!kevin
Soon to become {emory,gatech}!nanovx!dbses0!kevin (But not yet!)
Technical Details
Message-ID:
<1488@msa3b.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!emory!wa4mei!nanovx!msa3b!kevinShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!emory!wa4mei!nanovx!msa3b!kevin From: kevin@msa3b.UUCP (Kevin P. Kleinfelter) Newsgroups: comp.windows.ms.programmer Subject: Modeless Dialogs vs Globals Message-ID: <1488@msa3b.UUCP> Date: 7 Jan 91 20:47:59 GMT Organization: Dun and Bradstreet Software, Inc., Atlanta, GA Lines: 27