Hi Jon, Martin,
On 20 December 2014 at 12:09, JonY <[email protected]> wrote:
> Hi,
>
> Sorry about the delay, but after looking at it, these are overloaded
> methods. It works perfectly in C++ but not in C, there is no simple way
> to fix this.
I was thinking about this a little deeper. COM is meant to be a binary
interface that all languages could use. As such, it would be much more
useful for "a vendor" to publish machine readable interface definitions so
that language bindings could be automatically generated from these binary
specs.
- index of function in table
- name of function + alternate name if language does not support
overloading
- type of arguments
- type of return value
Maybe if I dig a little deper into COM, I'll find these specs...
Anyway, here's my patch "release early, release often" :)
That allows my test.c to compile (#include <dwrite.h>)
diff -Nu include_bak//combaseapi.h include/combaseapi.h
--- include_bak//combaseapi.h 2014-12-22 12:34:12 +1100
+++ include/combaseapi.h 2014-12-22 13:26:31 +1100
@@ -91,6 +91,11 @@
#define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE *method)
#define STDMETHODV_(type, method) type (STDMETHODVCALLTYPE *method)
+#define STDMETHOD_BASE(base, method) HRESULT (STDMETHODCALLTYPE
*base##_##method)
+#define STDMETHOD_BASE_(base, type, method) type (STDMETHODCALLTYPE
*base##_##method)
+#define STDMETHODV_BASE(base, method) HRESULT (STDMETHODVCALLTYPE
*base##_##method)
+#define STDMETHODV_BASES_(base, type, method) type (STDMETHODVCALLTYPE
*base##_##method)
+
#define IFACEMETHOD(method) STDMETHOD (method)
#define IFACEMETHOD_(type, method) STDMETHOD_ (type, method)
#define IFACEMETHODV(method) STDMETHODV (method)
diff -Nu include_bak//dwrite.h include/dwrite.h
--- include_bak//dwrite.h 2014-12-22 12:34:26 +1100
+++ include/dwrite.h 2014-12-22 13:20:39 +1100
@@ -1843,7 +1843,9 @@
#undef INTERFACE
#define INTERFACE IDWriteTextLayout
-DECLARE_INTERFACE_(IDWriteTextLayout,IDWriteTextFormat)
+#undef BASEIFACE
+#define BASEIFACE IDWriteTextFormat
+DECLARE_INTERFACE_(INTERFACE,BASEIFACE)
{
BEGIN_INTERFACE
@@ -1885,18 +1887,18 @@
DWRITE_LINE_SPACING_METHOD *lineSpacingMethod,
FLOAT *lineSpacing,
FLOAT *baseline) PURE;
- STDMETHOD(GetFontCollection)(THIS_
+ STDMETHOD_BASE(IDWriteTextFormat, GetFontCollection)(THIS_
IDWriteFontCollection **fontCollection) PURE;
- STDMETHOD_(UINT32, GetFontFamilyNameLength)(THIS) PURE;
- STDMETHOD(GetFontFamilyName)(THIS_
+ STDMETHOD_BASE_(BASEIFACE, UINT32, GetFontFamilyNameLength)(THIS) PURE;
+ STDMETHOD_BASE(BASEIFACE, GetFontFamilyName)(THIS_
WCHAR *fontFamilyName,
UINT32 nameSize) PURE;
- STDMETHOD_(DWRITE_FONT_WEIGHT, GetFontWeight)(THIS) PURE;
- STDMETHOD_(DWRITE_FONT_STYLE, GetFontStyle)(THIS) PURE;
- STDMETHOD_(DWRITE_FONT_STRETCH, GetFontStretch)(THIS) PURE;
- STDMETHOD_(FLOAT, GetFontSize)(THIS) PURE;
- STDMETHOD_(UINT32, GetLocaleNameLength)(THIS) PURE;
- STDMETHOD(GetLocaleName)(THIS_
+ STDMETHOD_BASE_(BASEIFACE, DWRITE_FONT_WEIGHT, GetFontWeight)(THIS)
PURE;
+ STDMETHOD_BASE_(BASEIFACE, DWRITE_FONT_STYLE, GetFontStyle)(THIS) PURE;
+ STDMETHOD_BASE_(BASEIFACE, DWRITE_FONT_STRETCH, GetFontStretch)(THIS)
PURE;
+ STDMETHOD_BASE_(BASEIFACE, FLOAT, GetFontSize)(THIS) PURE;
+ STDMETHOD_BASE_(BASEIFACE, UINT32, GetLocaleNameLength)(THIS) PURE;
+ STDMETHOD_BASE( BASEIFACE, GetLocaleName)(THIS_
WCHAR *localeName,
UINT32 nameSize) PURE;
Please shoot me down in flames so I can do a better job!
Ta, Jack
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public