Problem including DDEML.H
Sanjay -- SGUPTA@aegonusa.com
Friday, January 05, 1996
I am trying to create a simple DDE aware AppWizard generated application
in VC++1.52. In MAINFRM.CPP, I include after STDAFX.H and I get
the following compilation error:
Error: ddeml.h (error C2371) HSZ redefinition, different basic types.
And then if I take out include for AFXEXT.H from STDAFX.H, the program
compiles ok. Could somebody please let me know how can I include DDEML.H
correctly without having to take out AFXEXT.H.
Sanjay Gupta
SGUPTA@AEGONUSA.COM
Steven Lewis -- smlewis@wln.com
Saturday, January 06, 1996
>
>
>I am trying to create a simple DDE aware AppWizard generated application
>in VC++1.52. In MAINFRM.CPP, I include after STDAFX.H and I get
>the following compilation error:
>
>Error: ddeml.h (error C2371) HSZ redefinition, different basic types.
>
>And then if I take out include for AFXEXT.H from STDAFX.H, the program
>compiles ok. Could somebody please let me know how can I include DDEML.H
>correctly without having to take out AFXEXT.H.
>
>Sanjay Gupta
>SGUPTA@AEGONUSA.COM
>
>
Add these lines to stdafx.h
// Afx has a poor definition of HSZ
#define HSZ mfcHSZ
#define HSZ__ mfcHSZ
#include // MFC core and standard components
#include // MFC extensions
#include // stream io
#undef boolean
// we have some trouble with resource.h if this is in
#undef _AFXRES
#undef HSZ
#undef HSZ__
Peter Jahans -- pjahans@houston.geoquest.slb.com
Sunday, January 07, 1996
>
> I am trying to create a simple DDE aware AppWizard generated application
> in VC++1.52. In MAINFRM.CPP, I include after STDAFX.H and I get
> the following compilation error:
>
> Error: ddeml.h (error C2371) HSZ redefinition, different basic types.
>
> And then if I take out include for AFXEXT.H from STDAFX.H, the program
> compiles ok. Could somebody please let me know how can I include DDEML.H
> correctly without having to take out AFXEXT.H.
>
> Sanjay Gupta
> SGUPTA@AEGONUSA.COM
>
The naming clash occurs between the VBX support and DDEML code.
Place all your DDEML calls in a module (or modules) that don't
reference VBX controls. At the top of those modules, place the
line:
#define NO_VBX_SUPPORT
before including stdafx.h. The error message should go away.
--
Peter C. Jahans mailto:jahans@slb.com
Houston, TX
Mike Blaszczak -- mikeblas@interserv.com
Sunday, January 07, 1996
On Fri, 5 Jan 1996, "Gupta, Sanjay" wrote:
>
>
>I am trying to create a simple DDE aware AppWizard generated application
>in VC++1.52. In MAINFRM.CPP, I include after STDAFX.H and I get
>the following compilation error:
>
>Error: ddeml.h (error C2371) HSZ redefinition, different basic types.
I don't usually answer 16-bit questions, but here is the answer from the
Microsoft KnowledgeBase article number Q99871:
Title: PRB: Using HSZ in AFXEXT.H and DDEML.H
Document Number: Q98871 Publ Date: 16-MAY-1995
Product Name: Microsoft Windows Software Development Kit
Product Version: 3.00 3.10
Operating System: WINDOWS
----------------------------------------------------------------------
The information in this article applies to:
- Microsoft Windows Software Development Kit (SDK) for Windows
versions 3.0 and 3.1
----------------------------------------------------------------------
SYMPTOMS
========
When using both the AFXEXT.H and DDEML.H include files in the same
source file, the following message is received:
error C2371: 'HSZ' : redefinition; different basic types
CAUSE
=====
The problem is a naming conflict between Dynamic Date Exchange
Management Library (DDEML) and Visual Basic eXtension (VBX) files
controls, in which both use the type HSZ [handle to a string that is
zero (NULL) terminated] but with with different meanings.
AFXEXT.h includes the definition of HSZ in order to support the
Control Development Kit (CDK), and DDEML.H uses HSZ as a string type.
RESOLUTION
==========
Workarounds for this problem include:
- Separate the DDEML and VBX code into different files, thus
preventing AFXEXT.H and DDEML.H from being included in the same source
file.
-or-
- Use #define NO_VBX_SUPPORT in the file that implements DDE. This
will cause DDEML's definition of HSZ to be used.
Additional reference words: 3.10 c2371
KBCategory: kbprg kbprb
KBSubcategory: UsrDde
COPYRIGHT Microsoft Corporation, 1995.
You could have found it by searcing for "HSZ" and "DDEML" and "include"
through the text of all articles in the MSKB.
.B ekiM
--
TCHAR szDisc[] = _T("These words are my own; I do not speak for Microsoft.");
| Вернуться в корень Архива
|