<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[COM, IDL, size_is, geht net :(]]></title><description><![CDATA[<p>Wir versuchen hier gerade einen COM Server (.exe) zum laufen zu bringen der dual Interfaces mit Arrays verwendet.<br />
Da das ganze schnell gehen muss haben wir dazu VS2005 mit attributed C++ verwendet.<br />
Compilieren tut auch alles brav, bloss funktionieren tut es irgendwie nicht so ganz - er scheint das size_is komplett zu ignorieren. Soll heissen: er marschallt nur jeweils ein Element, egal was wir für eine Grösse angeben.</p>
<p>Im generierten IDL File ist das size_is allerdings noch enthalten, nur das automatische Marshalling ... haut eben nicht hin.</p>
<p>Ein konkretes Beispiel was wir probiert haben:</p>
<pre><code class="language-cpp">[export]
typedef struct tagPropertyVariant
{
    BYTE m_type;
    VARIANT m_value;
} PropertyVariant;

// im Interface:
HRESULT WriteProperties(unsigned long numberofProperties, [in, size_is(numberofProperties)] const BSTR* propertyNames, [in, size_is(numberofProperties)] const PropertyVariant* propertyValues);
</code></pre>
<p>numberofProperties wird Clientseitig dabei auf 2 gesetzt, propertyNames und propertyValues zeigen auf je ein Array mit 2 Einträgen. Serverseitig ist numberofProperties immer noch brav 2, das erste Element in den Arrays stimmt auch noch, aber das 2. ist &quot;nicht da&quot;.</p>
<p>Was tun? Machen wir irgendetwas falsch, oder wird das vom automatischen Marshaling nicht unterstützt?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/192300/com-idl-size_is-geht-net</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 22:08:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192300.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Sep 2007 16:36:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to COM, IDL, size_is, geht net :( on Wed, 12 Sep 2007 16:36:09 GMT]]></title><description><![CDATA[<p>Wir versuchen hier gerade einen COM Server (.exe) zum laufen zu bringen der dual Interfaces mit Arrays verwendet.<br />
Da das ganze schnell gehen muss haben wir dazu VS2005 mit attributed C++ verwendet.<br />
Compilieren tut auch alles brav, bloss funktionieren tut es irgendwie nicht so ganz - er scheint das size_is komplett zu ignorieren. Soll heissen: er marschallt nur jeweils ein Element, egal was wir für eine Grösse angeben.</p>
<p>Im generierten IDL File ist das size_is allerdings noch enthalten, nur das automatische Marshalling ... haut eben nicht hin.</p>
<p>Ein konkretes Beispiel was wir probiert haben:</p>
<pre><code class="language-cpp">[export]
typedef struct tagPropertyVariant
{
    BYTE m_type;
    VARIANT m_value;
} PropertyVariant;

// im Interface:
HRESULT WriteProperties(unsigned long numberofProperties, [in, size_is(numberofProperties)] const BSTR* propertyNames, [in, size_is(numberofProperties)] const PropertyVariant* propertyValues);
</code></pre>
<p>numberofProperties wird Clientseitig dabei auf 2 gesetzt, propertyNames und propertyValues zeigen auf je ein Array mit 2 Einträgen. Serverseitig ist numberofProperties immer noch brav 2, das erste Element in den Arrays stimmt auch noch, aber das 2. ist &quot;nicht da&quot;.</p>
<p>Was tun? Machen wir irgendetwas falsch, oder wird das vom automatischen Marshaling nicht unterstützt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364146</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364146</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Wed, 12 Sep 2007 16:36:09 GMT</pubDate></item><item><title><![CDATA[Reply to COM, IDL, size_is, geht net :( on Thu, 13 Sep 2007 18:29:35 GMT]]></title><description><![CDATA[<p>Ok. Habe jetzt selbst herausgefunden dass Interfaces mit size_is o.ä. anscheinend nicht automation kompatibel sind, und daher auch nicht automatisch gemarshalt werden. Auch doof.</p>
<p>Die Alternative ist SAFEARRAYs zu verwenden, was wir wohl auch machen werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364847</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364847</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Thu, 13 Sep 2007 18:29:35 GMT</pubDate></item></channel></rss>