The current generated code results in the following error: error: constructor cannot have a return type
The proper interface to use is IApplicationDataSetVersionHandler and contains a single method: Invoke(ISetVersionRequest) which corresponds to the constructor described at [1] passing a SetVersionRequest object. widl doesn't understand the "delegate" keyword so we create the equivalent interface manually. [1] https://docs.microsoft.com/en-us/uwp/api/windows.storage.applicationdatasetversionhandler --- mingw-w64-headers/include/windows.storage.h | 86 ++++++++----------- mingw-w64-headers/include/windows.storage.idl | 8 +- 2 files changed, 40 insertions(+), 54 deletions(-) diff --git a/mingw-w64-headers/include/windows.storage.h b/mingw-w64-headers/include/windows.storage.h index 1107fdde..ef88d30c 100644 --- a/mingw-w64-headers/include/windows.storage.h +++ b/mingw-w64-headers/include/windows.storage.h @@ -116,14 +116,14 @@ namespace ABI { #endif /* __cplusplus */ #endif -#ifndef ____x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_FWD_DEFINED__ -#define ____x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_FWD_DEFINED__ -typedef interface __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler; +#ifndef ____x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_FWD_DEFINED__ +#define ____x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_FWD_DEFINED__ +typedef interface __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Storage { - interface ApplicationDataSetVersionHandler; + interface IApplicationDataSetVersionHandler; } } } @@ -312,20 +312,6 @@ namespace ABI { #endif /* __cplusplus */ #endif -#ifndef ____x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_FWD_DEFINED__ -#define ____x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_FWD_DEFINED__ -typedef interface __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler; -#ifdef __cplusplus -namespace ABI { - namespace Windows { - namespace Storage { - interface ApplicationDataSetVersionHandler; - } - } -} -#endif /* __cplusplus */ -#endif - #ifndef ____x_ABI_CWindows_CStorage_CISetVersionRequest_FWD_DEFINED__ #define ____x_ABI_CWindows_CStorage_CISetVersionRequest_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CStorage_CISetVersionRequest __x_ABI_CWindows_CStorage_CISetVersionRequest; @@ -1334,7 +1320,7 @@ namespace ABI { virtual HRESULT STDMETHODCALLTYPE SetVersionAsync( int desiredVersion, - ApplicationDataSetVersionHandler *handler, + IApplicationDataSetVersionHandler *handler, IInspectable **setVersionOperation) = 0; virtual HRESULT STDMETHODCALLTYPE ClearAllAsync( @@ -1414,7 +1400,7 @@ typedef struct __x_ABI_CWindows_CStorage_CIApplicationDataVtbl { HRESULT (STDMETHODCALLTYPE *SetVersionAsync)( __x_ABI_CWindows_CStorage_CIApplicationData *This, int desiredVersion, - __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler *handler, + __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler *handler, IInspectable **setVersionOperation); HRESULT (STDMETHODCALLTYPE *ClearAllAsync)( @@ -1512,7 +1498,7 @@ static FORCEINLINE HRESULT __x_ABI_CWindows_CStorage_CIApplicationData_GetTrustL static FORCEINLINE HRESULT __x_ABI_CWindows_CStorage_CIApplicationData_get_Version(__x_ABI_CWindows_CStorage_CIApplicationData* This,int *value) { return This->lpVtbl->get_Version(This,value); } -static FORCEINLINE HRESULT __x_ABI_CWindows_CStorage_CIApplicationData_SetVersionAsync(__x_ABI_CWindows_CStorage_CIApplicationData* This,int desiredVersion,__x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler *handler,IInspectable **setVersionOperation) { +static FORCEINLINE HRESULT __x_ABI_CWindows_CStorage_CIApplicationData_SetVersionAsync(__x_ABI_CWindows_CStorage_CIApplicationData* This,int desiredVersion,__x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler *handler,IInspectable **setVersionOperation) { return This->lpVtbl->SetVersionAsync(This,desiredVersion,handler,setVersionOperation); } static FORCEINLINE HRESULT __x_ABI_CWindows_CStorage_CIApplicationData_ClearAllAsync(__x_ABI_CWindows_CStorage_CIApplicationData* This,IInspectable **clearOperation) { @@ -1779,22 +1765,22 @@ static FORCEINLINE HRESULT __x_ABI_CWindows_CStorage_CIApplicationDataStatics_ge #endif /* ____x_ABI_CWindows_CStorage_CIApplicationDataStatics_INTERFACE_DEFINED__ */ /***************************************************************************** - * ApplicationDataSetVersionHandler interface + * IApplicationDataSetVersionHandler interface * */ -#ifndef ____x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_INTERFACE_DEFINED__ -#define ____x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_INTERFACE_DEFINED__ +#ifndef ____x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_INTERFACE_DEFINED__ +#define ____x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_INTERFACE_DEFINED__ -DEFINE_GUID(IID___x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler, 0xa05791e6, 0xcc9f, 0x4687, 0xac,0xab, 0xa3,0x64,0xfd,0x78,0x54,0x63); +DEFINE_GUID(IID___x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler, 0xa05791e6, 0xcc9f, 0x4687, 0xac,0xab, 0xa3,0x64,0xfd,0x78,0x54,0x63); #if defined(__cplusplus) && !defined(CINTERFACE) } /* extern "C" */ namespace ABI { namespace Windows { namespace Storage { MIDL_INTERFACE("a05791e6-cc9f-4687-acab-a364fd785463") - ApplicationDataSetVersionHandler : public IUnknown + IApplicationDataSetVersionHandler : public IUnknown { - virtual HRESULT STDMETHODCALLTYPE ApplicationDataSetVersionHandler( + virtual HRESULT STDMETHODCALLTYPE Invoke( ISetVersionRequest *setVersionRequest) = 0; }; @@ -1803,65 +1789,65 @@ namespace ABI { } extern "C" { #ifdef __CRT_UUID_DECL -__CRT_UUID_DECL(ABI::Windows::Storage::ApplicationDataSetVersionHandler, 0xa05791e6, 0xcc9f, 0x4687, 0xac,0xab, 0xa3,0x64,0xfd,0x78,0x54,0x63) +__CRT_UUID_DECL(ABI::Windows::Storage::IApplicationDataSetVersionHandler, 0xa05791e6, 0xcc9f, 0x4687, 0xac,0xab, 0xa3,0x64,0xfd,0x78,0x54,0x63) #endif #else -typedef struct __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandlerVtbl { +typedef struct __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandlerVtbl { BEGIN_INTERFACE /*** IUnknown methods ***/ HRESULT (STDMETHODCALLTYPE *QueryInterface)( - __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler *This, + __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler *This, REFIID riid, void **ppvObject); ULONG (STDMETHODCALLTYPE *AddRef)( - __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler *This); + __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler *This); ULONG (STDMETHODCALLTYPE *Release)( - __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler *This); + __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler *This); - /*** ApplicationDataSetVersionHandler methods ***/ - HRESULT (STDMETHODCALLTYPE *ApplicationDataSetVersionHandler)( - __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler *This, + /*** IApplicationDataSetVersionHandler methods ***/ + HRESULT (STDMETHODCALLTYPE *Invoke)( + __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler *This, __x_ABI_CWindows_CStorage_CISetVersionRequest *setVersionRequest); END_INTERFACE -} __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandlerVtbl; +} __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandlerVtbl; -interface __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler { - CONST_VTBL __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandlerVtbl* lpVtbl; +interface __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler { + CONST_VTBL __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandlerVtbl* lpVtbl; }; #ifdef COBJMACROS #ifndef WIDL_C_INLINE_WRAPPERS /*** IUnknown methods ***/ -#define __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) -#define __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_AddRef(This) (This)->lpVtbl->AddRef(This) -#define __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_Release(This) (This)->lpVtbl->Release(This) -/*** ApplicationDataSetVersionHandler methods ***/ -#define __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_ApplicationDataSetVersionHandler(This,setVersionRequest) (This)->lpVtbl->ApplicationDataSetVersionHandler(This,setVersionRequest) +#define __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_AddRef(This) (This)->lpVtbl->AddRef(This) +#define __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_Release(This) (This)->lpVtbl->Release(This) +/*** IApplicationDataSetVersionHandler methods ***/ +#define __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_Invoke(This,setVersionRequest) (This)->lpVtbl->Invoke(This,setVersionRequest) #else /*** IUnknown methods ***/ -static FORCEINLINE HRESULT __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_QueryInterface(__x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler* This,REFIID riid,void **ppvObject) { +static FORCEINLINE HRESULT __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_QueryInterface(__x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler* This,REFIID riid,void **ppvObject) { return This->lpVtbl->QueryInterface(This,riid,ppvObject); } -static FORCEINLINE ULONG __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_AddRef(__x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler* This) { +static FORCEINLINE ULONG __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_AddRef(__x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler* This) { return This->lpVtbl->AddRef(This); } -static FORCEINLINE ULONG __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_Release(__x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler* This) { +static FORCEINLINE ULONG __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_Release(__x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler* This) { return This->lpVtbl->Release(This); } -/*** ApplicationDataSetVersionHandler methods ***/ -static FORCEINLINE HRESULT __x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_ApplicationDataSetVersionHandler(__x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler* This,__x_ABI_CWindows_CStorage_CISetVersionRequest *setVersionRequest) { - return This->lpVtbl->ApplicationDataSetVersionHandler(This,setVersionRequest); +/*** IApplicationDataSetVersionHandler methods ***/ +static FORCEINLINE HRESULT __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_Invoke(__x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler* This,__x_ABI_CWindows_CStorage_CISetVersionRequest *setVersionRequest) { + return This->lpVtbl->Invoke(This,setVersionRequest); } #endif #endif #endif -#endif /* ____x_ABI_CWindows_CStorage_CApplicationDataSetVersionHandler_INTERFACE_DEFINED__ */ +#endif /* ____x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler_INTERFACE_DEFINED__ */ /***************************************************************************** * ISetVersionRequest interface diff --git a/mingw-w64-headers/include/windows.storage.idl b/mingw-w64-headers/include/windows.storage.idl index 0c7b0060..f815aeb0 100644 --- a/mingw-w64-headers/include/windows.storage.idl +++ b/mingw-w64-headers/include/windows.storage.idl @@ -30,7 +30,7 @@ namespace Windows { interface IApplicationDataStatics; interface IApplicationDataSetVersionHandler; interface ApplicationDataContainer; - interface ApplicationDataSetVersionHandler; //delegate + // delegate ApplicationDataSetVersionHandler; interface ISetVersionRequest; interface ISetVersionDeferral; typedef enum StorageDeleteOption StorageDeleteOption; @@ -143,7 +143,7 @@ namespace Windows { [uuid(C3DA6FB7-B744-4B45-B0B8-223A0938D0DC)] interface IApplicationData : IInspectable { [propget] HRESULT Version(int* value); - HRESULT SetVersionAsync(int desiredVersion, ApplicationDataSetVersionHandler* handler, /*IAsyncAction*/ IInspectable** setVersionOperation); + HRESULT SetVersionAsync(int desiredVersion, IApplicationDataSetVersionHandler* handler, /*IAsyncAction*/ IInspectable** setVersionOperation); HRESULT ClearAllAsync(/*IAsyncAction*/ IInspectable** clearOperation); HRESULT ClearAsync(ApplicationDataLocality locality, /*IAsyncAction*/ IInspectable** clearOperation); [propget] HRESULT LocalSettings(IApplicationDataContainer** value); @@ -168,8 +168,8 @@ namespace Windows { } [uuid(A05791E6-CC9F-4687-ACAB-A364FD785463)] - interface ApplicationDataSetVersionHandler : IUnknown { - HRESULT ApplicationDataSetVersionHandler(ISetVersionRequest* setVersionRequest); + interface IApplicationDataSetVersionHandler : IUnknown { + HRESULT Invoke(ISetVersionRequest* setVersionRequest); } [uuid(B9C76B9B-1056-4E69-8330-162619956F9B)] -- 2.29.2 _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public