PRB: Inadequate Buffer Length Causes Strange Problems in DDEMLLast reviewed: November 2, 1995Article ID: Q107387 |
The information in this article applies to:
SYMPTOMSSpecifying an inadequate buffer length for an XTYP_POKE or an XTYP_EXECUTE command causes strange problems in DDEML. Problems can range from a general protection (GP) fault or Exception 13, to DDEML timeout errors (such as DMLERR_EXECACKTIMEOUT or DMLERR_POKEACKTIMEOUT) or a DDEML transaction failure (or DMLERR_NOTPROCESSED). Sometimes, the application may seem to work for the most part, and then occasionally crash. Data can be passed to the server application via XTYP_POKE or XTYP_EXECUTE in two ways:
CAUSEBecause data is most commonly passed between applications in CF_TEXT format, a common problem with the string buffer length is setting it to lstrlen (lpszString), where lpszString is the buffer containing the string the client needs to pass to the server. Because the lstrlen() function does not include the terminating null character, this can cause the system to append garbage characters to the end of the string, thus sending an invalid string to the server application.
RESOLUTIONWhen passing strings between two applications, the string buffer length should be set to lstrlen (lpszString) +1, to include the terminating null character ('\0'). Using DDESPY, it is easy to track down this problem, because one can follow the string being passed from the client to the server application. Garbage characters incorrectly being appended to the string usually indicate a problem with specifying an inadequate string buffer length.
|
Additional reference words: 3.10 3.50 3.51 4.00 95 gpf gp-fault
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |