<?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[Structs aus DLL unter Excel einsetzen]]></title><description><![CDATA[<p>Ich habe eine DLL unter C mit Hilfe der Windows API programmiert und möchte nun diese unter Excel einsetzen. Ich habe aber ein Problem beim Einbinden von Funktionen in VBA, welche ein Struct benutzen.</p>
<p>Die Funktionen, welche keine Structs besitzen kann ich ja mittles</p>
<pre><code>Declare Function MeineFunction Lib &quot;\MeineDLL.dll&quot; () As Integer
</code></pre>
<p>einbinden.</p>
<p>Aber wie mache ich das wenn in dem Quelltext der DLL folgendes steht ?</p>
<pre><code class="language-cpp">typedef struct
{
  unsigned int Version;
  unsigned int CopyRightYear;
} tVersion;

__declspec(dllexport) tVersion GetMyVersion()
{
  ...
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/232946/structs-aus-dll-unter-excel-einsetzen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 02:50:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/232946.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Jan 2009 10:52:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Structs aus DLL unter Excel einsetzen on Thu, 29 Jan 2009 10:52:07 GMT]]></title><description><![CDATA[<p>Ich habe eine DLL unter C mit Hilfe der Windows API programmiert und möchte nun diese unter Excel einsetzen. Ich habe aber ein Problem beim Einbinden von Funktionen in VBA, welche ein Struct benutzen.</p>
<p>Die Funktionen, welche keine Structs besitzen kann ich ja mittles</p>
<pre><code>Declare Function MeineFunction Lib &quot;\MeineDLL.dll&quot; () As Integer
</code></pre>
<p>einbinden.</p>
<p>Aber wie mache ich das wenn in dem Quelltext der DLL folgendes steht ?</p>
<pre><code class="language-cpp">typedef struct
{
  unsigned int Version;
  unsigned int CopyRightYear;
} tVersion;

__declspec(dllexport) tVersion GetMyVersion()
{
  ...
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1654273</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654273</guid><dc:creator><![CDATA[Bitte ein Bit]]></dc:creator><pubDate>Thu, 29 Jan 2009 10:52:07 GMT</pubDate></item><item><title><![CDATA[Reply to Structs aus DLL unter Excel einsetzen on Thu, 29 Jan 2009 11:09:50 GMT]]></title><description><![CDATA[<p><a href="http://www.codeproject.com/KB/atl/udtdemo.aspx" rel="nofollow">Using User Defined Types in COM &amp; ATL</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654278</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654278</guid><dc:creator><![CDATA[audacia]]></dc:creator><pubDate>Thu, 29 Jan 2009 11:09:50 GMT</pubDate></item><item><title><![CDATA[Reply to Structs aus DLL unter Excel einsetzen on Thu, 29 Jan 2009 17:31:33 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>von der DLL wird zu VBA nur ein Zeiger auf die Struktur übergeben. Du musst in VBA diese Struktur nachbauen:</p>
<p>zb:</p>
<pre><code>Private Type MyType
   Version As Long
   CopyRightYear AS Long
End Type
</code></pre>
<p>Dementsprechend deklarieren:</p>
<pre><code>Declare Sub GetMyVersion Lib &quot;Deine.dll&quot; ( _
   Byref dieStruktur As MyType)
</code></pre>
<p>das wars.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654529</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654529</guid><dc:creator><![CDATA[CStern]]></dc:creator><pubDate>Thu, 29 Jan 2009 17:31:33 GMT</pubDate></item><item><title><![CDATA[Reply to Structs aus DLL unter Excel einsetzen on Fri, 30 Jan 2009 08:03:10 GMT]]></title><description><![CDATA[<p>Danke für euere Antworten. Das von audacia ist genau das was ich auch gesucht habe.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20811">@CStern</a><br />
Deine Antwort ist auch gut, hat aber einen Nachteil das ich sobald eine Änderung an dem Struct erfolgt, ich das entpsrechende Excel-Sheet auch ändern muss.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654802</guid><dc:creator><![CDATA[Bitte ein Bit]]></dc:creator><pubDate>Fri, 30 Jan 2009 08:03:10 GMT</pubDate></item><item><title><![CDATA[Reply to Structs aus DLL unter Excel einsetzen on Fri, 30 Jan 2009 10:10:15 GMT]]></title><description><![CDATA[<p>Wenn Du grundsätzlich COM einsetzt, warum verwendest Du nicht pure COM Typen, wie Variants und SafeArrays. Damit kann man auch mehrere Datenfelder in einer variable übergeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654856</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654856</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 30 Jan 2009 10:10:15 GMT</pubDate></item></channel></rss>