DOCERR: DdeQueryConvInfo() Returns Zero When Called

Last reviewed: July 23, 1997
Article ID: Q111012
3.10 WINDOWS kbprg kbdocerr

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1

SYMPTOMS

The DdeQueryConvInfo() function returns zero when called to retrieve information about a DDE conversation.

CAUSE

The function returns zero when the cb member of the CONVINFO structure is not properly initialized prior to calling DdeQueryConvInfo().

The documentation for the lpConvInfo parameter of the DdeQueryConvInfo() function in the Windows 3.1 SDK "Programmer's Reference, Volume 2: Functions" manual mentions how the cb member of the CONVINFO structure must specify the length of the structure. However, the code sample right below it omits the initialization part before the function call, and thus causes confusion.

RESOLUTION

The cb member of the CONVINFO structure should be initialized to the size of the structure, as sample in the code sample below:

   CONVINFO ci;

   ci.cb = sizeof (CONVINFO);
   DdeQueryConvInfo(hConv, QID_SYNC, &ci);

MORE INFORMATION

Although this problem occurs in the DDEML version that ships with Microsoft Windows version 3.1, the problem has been fixed in the version that ships with Microsoft Windows for Workgroups version 3.1, because it added more robust handling to the DdeQueryConvInfo() function to correctly initialize an improperly set cb field when the function is called. For compatibility purposes, however, initializing the structure as described above is recommended.

For more information on the changes made between the Windows 3.1 and Windows for Workgroups 3.1 versions of DDEML, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q102572
   TITLE     : Changes Between Win 3.1 and WFW Versions of DDEML


Additional reference words: 3.10
KBCategory: kbprg kbdocerr
KBSubcategory: UsrDde
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 23, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.