Article View: comp.os.ms-windows.programmer.misc
Article #2904DdeClientTransaction() error - false alarm?
From: Charlie Gibbs
Date: Fri, 10 Dec 1999 00:00
Date: Fri, 10 Dec 1999 00:00
42 lines
2661 bytes
2661 bytes
When is an error not an error? How can DdeClientTransaction() return zero when a subsequent DdeGetLastError() returns DMLERR_NO_ERROR? We've started getting strange crashes at a couple of customer sites (all NT, I believe). They're running a suite of programs I've compiled using BCB4. In each case the problem occurs in a DDEML client. The DDEML server program runs 24 hours a day, collecting data; whenever the client is up it receives data from the server, and may also send data to the server for transmission. (The server buffers any data that comes in when the client isn't running.) The server processes many different transactions (reads and writes on various data streams, status requests, etc.). To keep things co-ordinated, the client first sends a request packet to the server with DdeClientTransaction (...XTYP_EXECUTE...). After the server processes the request, the client retrieves the result with DdeClientTransaction (...XTYP_REQUEST...). Synchronous transactions are used throughout. At most sites this scheme works very well. However, at two or three sites we've started to get strange results. Once or twice a day, the client program's DdeClientTransaction (...XTYP_REQUEST...) gets a return code of zero, which according to any documentation I've read indicates an error. I immediately call DdeGetLastError(), issue an error message containing the result, and retry the transaction. However, in this case DdeGetLastError() returns DMLERR_NO_ERROR! When I retry the transaction, I get DMLERR_REENTRANCY. After a number of retries, my program bombs in DDEML.DLL. Sometimes the entire system locks up as well. How can DdeClientTransaction() say that an error occurred, when DdeGetLastError() called immediately afterwards says that no error occurred? For now, I'm adding code to check for DMLERR_NO_ERROR, and if so to assume that DdeClientTransaction()'s zero return code was a false alarm. We'll see how it works, but it gives me the willies. What's going on here? -- cgibbs@sky.bus.com (Charlie Gibbs) Remove the first period after the "at" sign to reply.
Technical Details
Message-ID:
<2098.13T544T11213557@sky.bus.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5ca7,fb629701f089a2c6,start X-Google-Attributes: gidf5ca7,public X-Google-Thread: 105df1,fb629701f089a2c6,start X-Google-Attributes: gid105df1,public From: "Charlie Gibbs" <cgibbs@sky.bus.com> Subject: DdeClientTransaction() error - false alarm? Date: 1999/12/10 Message-ID: <2098.13T544T11213557@sky.bus.com> X-Deja-AN: 559246624 Organization: http://extra.newsguy.com Newsgroups: comp.os.ms-windows.programmer.misc,borland.public.cppbuilder.winapi