From: SourceForge.net <no...@so...> - 2006-04-28 14:11:53
|
Bugs item #1463470, was opened at 2006-04-03 12:51 Message generated for change (Comment added) made by papadopo You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1463470&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Oliver Stoeneberg (kidkat) Assigned to: Nobody/Anonymous (nobody) Summary: problem with IPropertySetStorage::Open() Initial Comment: this code: IPropertyStorage *pPropStg = NULL; // Open summary information, getting an IpropertyStorage HRESULT hr = pPropSetStg->Open(FMTID_SummaryInformation, STGM_READ | STGM_SHARE_EXCLUSIVE, &pPropStg); will produce an error: no matching function for call to `IPropertySetStorage::Open(const FMTID&, int, IPropertyStorage**)' candidates are: virtual HRESULT IPropertySetStorage::Open(FMTID*, DWORD, IPropertyStorage**) ---------------------------------------------------------------------- >Comment By: Dimitri Papadopoulos (papadopo) Date: 2006-04-28 16:11 Message: Logged In: YES user_id=52414 OK, here is what I see in MinGW's <basetyps.h>: typedef struct _GUID [...]*REFGUID; typedef IID *REFIID; typedef CLSID *REFCLSID; typedef FMTID *REFFMTID; [...] #ifndef _REFGUID_DEFINED #if defined (__cplusplus) && !defined (CINTERFACE) #define REFGUID const GUID& #define REFIID const IID& #define REFCLSID const CLSID& #else #define REFGUID const GUID* const #define REFIID const IID* const #define REFCLSID const CLSID* const #endif I guess we just have to add REFFMTID to the list. To be precise we need to change to: #ifndef _REFGUID_DEFINED #if defined (__cplusplus) && !defined (CINTERFACE) #define REFGUID const GUID& #define REFIID const IID& #define REFCLSID const CLSID& #define REFFMTID const FMTID& #else #define REFGUID const GUID* const #define REFIID const IID* const #define REFCLSID const CLSID* const #define REFFMTID const FMTID* const #endif Does this work for you? ---------------------------------------------------------------------- Comment By: Oliver Stoeneberg (kidkat) Date: 2006-04-28 14:47 Message: Logged In: YES user_id=591019 kkez is right. In guiddef.h there is an __cplusplus #ifdef, that decides, if REFFMTID is a const IID pointer or a const IID reference. The definitions in wytpes.h are #if 0'd, so they can be ignored. FMTID is actually a typedef of GUID. ---------------------------------------------------------------------- Comment By: Dimitri Papadopoulos (papadopo) Date: 2006-04-28 14:16 Message: Logged In: YES user_id=52414 Indeed we have a problem here: 1) FMTID_SummaryInformation has type FMTID. 2) IPropertySetStorage::Open() expects REFFMTID which is defined in <basetyps.h> as FMTID*. However I'm not sure why you refer to <wtypes.h>? 1) REFFMTID is defined as FMTID* in <basetyps.h> in MinGW. 2) The exact type of REFFMTID is not documented by MSDN, although I would of course expect it to be a reference and not a pointer to FMTID. 3) I don't know whether it's defined in <basetyps.h> or <wtypes.h> in Microsoft's SDK. ---------------------------------------------------------------------- Comment By: kkez (kkez) Date: 2006-04-28 12:29 Message: Logged In: YES user_id=1355452 You need to compile your file as a c++ file (or viceversa). IIRC there's a different behavior when you compile it as a C file or a C++ file. ---------------------------------------------------------------------- Comment By: Oliver Stoeneberg (kidkat) Date: 2006-04-05 13:59 Message: Logged In: YES user_id=591019 That's not the problem. The problem is the first parameter. It thinks it's a const reference whre it expects a pointer. MSVC6 will compile this source this source. After looking a bit more into it: The problem is the REFFMTID type which is "FMTID *" in MinGW and either "const FMTID &" or "const FMTID * const" depending on defines in wtypes.h. The definition like MinGW uses it is also there, but it's in an #if 0 block. This also applies for REFGUID, REFIID and REFCLSID. ---------------------------------------------------------------------- Comment By: Dimitri Papadopoulos (papadopo) Date: 2006-04-05 09:17 Message: Logged In: YES user_id=52414 What if you change include/objbase.h from: #define STGM_READ 0 #define STGM_WRITE 1 #define STGM_READWRITE 2 #define STGM_SHARE_DENY_NONE 0x40 ... to: #define STGM_READ 0x00000000L #define STGM_WRITE 0x00000001L #define STGM_READWRITE 0x00000002L #define STGM_SHARE_DENY_NONE 0x00000040L .. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1463470&group_id=2435 |