Article View: comp.sys.mac.programmer.codewarrior
Article #1478Re: c++ and including ocidl.h build problem
From: MW Ron
Date: Fri, 20 Feb 2004 14:51
Date: Fri, 20 Feb 2004 14:51
71 lines
3328 bytes
3328 bytes
In article <e4af91cf.0402192248.476671ee@posting.google.com>,
David@alterconsulting.net (David Alter) wrote:
>I'm having a problem with compiling c++ and including <ocidl.h> for
>windows. I'm using Codewarrior 8.0. When I compiled this project as C
>it worked fine. Once I enable C++ I get the following error, and 70 or
>so like it.
Windows uses some stuff that is not legal C++ they treat struct and
class as different types with different rules. While C++ says they are
the same, (just one is public by default the other private by default)
Do you have treat all warnings as errors on? If so turn off the
inconsidtnet use of class and struct keywords
If that doesn't work can you preprocess a file that has this error and
send it to me (strip out as much as possible that still leaves the
error) and I'll check it out.
Thanks for any cooperation.
Ron
>Error : illegal struct/union/enum/class definition
>(included from:
> exdisp.h:238
> shlguid.h:220
> shlobj.h:102
> PC_ChooseDialog.cpp:1)
>ocidl.h line 566 IConnectionPoint : public IUnknown
>
>Error : illegal struct/union/enum/class definition
>(included from:
> exdisp.h:238
> shlguid.h:220
> shlobj.h:102
> PC_ChooseDialog.cpp:1)
>ocidl.h line 751 IEnumConnectionPoints : public IUnknown
>
>The problem appears to be with the "public IUnknown". If I edit
>ocidl.h and comment out the ": public IUnknown" It will get past that
>error. I have run it through the preprocessor and this is the output
>it generates.
>
>struct
>IEnumConnections : public IUnknown
>{
>public:
>virtual HRESULT __stdcall Next(
>ULONG cConnections,
>LPCONNECTDATA rgcd,
>ULONG *pcFetched) = 0;
>virtual HRESULT __stdcall Skip(
>ULONG cConnections) = 0;
>virtual HRESULT __stdcall Reset( void) = 0;
>virtual HRESULT __stdcall Clone(
>IEnumConnections * *ppEnum) = 0;
>};
>
>I would have thought it would have been class and not struct but I
>don't think that is the issue. What ever the case I should no be
>editing the Win32 .h files. Does anyone know what is going on here and
>how I can get around it.
>
>thanks
>-dave
--
Metrowerks, maker of CodeWarrior - "Software Starts Here"
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>
Technical Details
Message-ID:
<mwron-4D943E.09511520022004@news.newsguy.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.he.net!cyclone-sf.pbi.net!129.250.175.17!pln-w!spln!dex!extra.newsguy.com!newsp.newsguy.com!mwronReferences:
<e4af91cf.0402192248.476671ee@posting.google.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f635e,6d5d8293494eb1fb
X-Google-Attributes: gidf635e,public
X-Google-Thread: fd047,6d5d8293494eb1fb
X-Google-Attributes: gidfd047,public
X-Google-ArrivalTime: 2004-02-20 07:25:09 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.he.net!cyclone-sf.pbi.net!129.250.175.17!pln-w!spln!dex!extra.newsguy.com!newsp.newsguy.com!mwron
From: MW Ron <mwron@metrowerks.com>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.windows
Subject: Re: c++ and including ocidl.h build problem
Date: Fri, 20 Feb 2004 09:51:15 -0500
Organization: Metrowerks
Lines: 71
Message-ID: <mwron-4D943E.09511520022004@news.newsguy.com>
References: <e4af91cf.0402192248.476671ee@posting.google.com>
NNTP-Posting-Host: p-913.newsdawg.com
User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X)
X-Face: )mY~XFHLw)UOW!W#[Ljvxq6Ja7(g'#F0-g*&puNxR8hEJkd@Oue/70^.)I78\
(%a%&Id211u"l/t.llWo/M|?15XUlx9!IGkdWiEmcasiyg"k;Q9[~XuE+`t2"*n(>nmm
@L/q,TjMd5+H{gASEPDR^$