Microsoft KB Archive/330337

= BUG: DDExecute Function Returns DMLERR_NOT_PROCESSED =

Article ID: 330337

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Internet Explorer 5.0
 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q330337



SYMPTOMS
When you use dynamic data exchange (DDE) to establish a connection to Internet Explorer with WWW_OpenUrl, and you then use the DdeClientTransaction function with XTYP_EXECUTE to locate a specific Web page, the operation executes successfully, but Internet Explorer returns a DMLERR_NOTPROCESSED message instead of a DMLERR_NO_ERROR message.



CAUSE
Several years ago Spyglass Inc. defined a Software Development Interface (SDI) that has served as the basis for most common inter-process communication (IPC) support in current browsers. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

160957 INFO: DDE Support in Internet Explorer Versions

In the original specification, the OpenURL verb was implemented in DDE as an XTYP_REQUEST transaction type with the topic of WWW_OpenURL, where the name of the item that is requested is the parameter to the OpenURL verb.

A DDE request uses atoms to identify the name of the item that is being requested. However, because atom names are limited to 255 bytes, the DDE implementation of OpenURL cannot open URLs that are longer than 255 bytes. Because of this, Internet Explorer permits the OpenURL verb to use the XTYP_EXECUTE transaction type, where the command string is used to pass the parameters to OpenURL. The command string is not an atom and therefore does not have the size limitation.

However, internally, Internet Explorer still responds to a WWW_OpenURL execute transaction as if it were a request transaction, which causes the DDE client program to receive a return value that indicates an error. This occurs because a server is supposed to respond to a DDE execute transaction with a DDE ACK message or NACK message, but in this case Internet Explorer responds with a WM_DDE_DATA message, which is appropriate for a DDE request.



WORKAROUND
To work around this problem, determine the length of the URL. If the length is less than 255 bytes, use XTYP_REQUEST. If the length is greater than 255 bytes, use XTYP_EXECUTE.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior
The following sample code demonstrates DdeClientTransaction: // Connect to the service. HSZ service = DdeCreateStringHandle(instance, &quot;IExplore&quot;, 0); HSZ topic  = DdeCreateStringHandle(instance, &quot;WWW_OpenURL&quot;, 0); conv = DdeConnect(instance, service, topic, NULL); //Invoke DdeClientTransaction.

DWORD dummy = 0; LPBYTE vCmd = (LPBYTE)cmd; DdeClientTransaction(vCmd, len, conv, 0, 0, XTYP_EXECUTE, 2000, &dummy);

//You receive the error. rc = DdeGetLastError(instance);

