🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.ms-windows.programmer.misc
2 messages
2 total messages Started by Charlie Gibbs Fri, 10 Dec 1999 00:00
DdeClientTransaction() error - false alarm?
#2904
Author: Charlie Gibbs
Date: Fri, 10 Dec 1999 00:00
42 lines
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.
Re: DdeClientTransaction() error - false alarm?
#2903
Author: Chris Doran
Date: Mon, 13 Dec 1999 00:00
20 lines
1691 bytes
In article <2098.13T544T11213557@sky.bus.com>,
  "Charlie Gibbs" <cgibbs@sky.bus.com> wrote:
> When is an error not an error?  How can DdeClientTransaction() return
> zero when a subsequent DdeGetLastError() returns DMLERR_NO_ERROR?
> ...

FWIW, I've recently seen the reverse problem -- DdeClientTransaction()
says it succeeds, and my (synchronous write) succeeds, but
DdeGetLastError returns DMLERR_INVALIDPARAMETER (all my parameters are
valid, honest!) I've tracked the DMLERR_INVALIDPARAMETER back to
Dynamic Data Studio (which I'm using as the test server -- thanks,
Roger). It looks as though a server can insert something into
DdeGetLastError's memory independent of the function you last called
<insert Twilight Zone theme>. Willying indeed!

Chris


Sent via Deja.com http://www.deja.com/
Before you buy.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads