Article ID: 136218 - Last Review: November 21, 2006 - Revision: 2.2

BUG: DdeConnect Never Returns

This article was previously published under Q136218
Expand all | Collapse all

SYMPTOMS

A 32-bit application calls DdeConnect when all previous DDEML initialization has been performed. DdeConnect never returns.

CAUSE

Any thread that creates a top-level window and doesn't have a message loop will cause DdeConnect to block. This is because DdeConnect calls SendMessage(HWND_BROADCAST...). In this call, SendMessage will put the message in the target thread's message queue and block the calling thread. If the target thread doesn't have a message loop, it will never process this message and therefore never return.

One complication is that some things create windows without the knowledge of the calling thread. It is known that some SQL, RPC, and DDEML function calls will do this. Any top-level window that is created by a thread that has no message loop will cause this to happen.

RESOLUTION

The only current solution is to add a message loop to the thread that created the window.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

APPLIES TO
  • Microsoft Win32 Application Programming Interface, when used with:
    • Microsoft Windows NT Server 3.51
    • Microsoft Windows NT Workstation 3.51
    • Microsoft Windows 95
    • Microsoft Win32s 1.3
Keywords: 
kbbug KB136218
 

Article Translations