<?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[Übergabe eines VB - Strings an eine C++ Win32Dll]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>ich habe eine C++ Dll geschrieben, an eine Funktion dieser Dll möchte ich von VB aus einen String übergeben. In der entgegengesetzten Richtung klappts !<br />
Aber nicht von VB nach C++ Dll.:(</p>
<p>Hier mal meine Codes:</p>
<p>1. VB Projekt:</p>
<pre><code class="language-cpp">Option Explicit

Private Declare Function fnWin32DLL02 Lib &quot;E:\WORKING\OMRON\GDT\EigeneDLL\C++ DLL mit VB (Test01)\Win32DLL02.dll&quot; () As String

Private Sub Form_Load()

    Dim x As String
    Dim wert As String
    wert = Space$(4)
    wert = &quot;wert&quot;

    x = Space$(4)
    x = fnWin32DLL02(wert)
    MsgBox &quot;X ist: &quot; &amp; x

End Sub
</code></pre>
<p>Bekomme so aber den Fehler &quot;Falsche Anzahl an Argumenten oder ungültige Zuweisung einer Eigenschaft&quot;.</p>
<p>2. C++ DLL (.cpp):</p>
<pre><code class="language-cpp">WIN32DLL02_API BSTR fnWin32DLL02(BSTR wert)
{
	BSTR x;
	x = SysAllocString(L&quot;abc&quot;);
 	SysFreeString(x);  
	return  x;
}
</code></pre>
<p>3. C++ DLL (.h):</p>
<pre><code class="language-cpp">WIN32DLL02_API BSTR fnWin32DLL02(BSTR);
</code></pre>
<p>Hoffe Ihr könnt mir da weiterhelfen.<br />
Vielen Dank für Eure Hilfe.<br />
ShadowEater <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/201873/übergabe-eines-vb-strings-an-eine-c-win32dll</link><generator>RSS for Node</generator><lastBuildDate>Mon, 29 Jun 2026 01:13:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/201873.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 05 Jan 2008 10:54:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Übergabe eines VB - Strings an eine C++ Win32Dll on Sat, 05 Jan 2008 10:54:17 GMT]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>ich habe eine C++ Dll geschrieben, an eine Funktion dieser Dll möchte ich von VB aus einen String übergeben. In der entgegengesetzten Richtung klappts !<br />
Aber nicht von VB nach C++ Dll.:(</p>
<p>Hier mal meine Codes:</p>
<p>1. VB Projekt:</p>
<pre><code class="language-cpp">Option Explicit

Private Declare Function fnWin32DLL02 Lib &quot;E:\WORKING\OMRON\GDT\EigeneDLL\C++ DLL mit VB (Test01)\Win32DLL02.dll&quot; () As String

Private Sub Form_Load()

    Dim x As String
    Dim wert As String
    wert = Space$(4)
    wert = &quot;wert&quot;

    x = Space$(4)
    x = fnWin32DLL02(wert)
    MsgBox &quot;X ist: &quot; &amp; x

End Sub
</code></pre>
<p>Bekomme so aber den Fehler &quot;Falsche Anzahl an Argumenten oder ungültige Zuweisung einer Eigenschaft&quot;.</p>
<p>2. C++ DLL (.cpp):</p>
<pre><code class="language-cpp">WIN32DLL02_API BSTR fnWin32DLL02(BSTR wert)
{
	BSTR x;
	x = SysAllocString(L&quot;abc&quot;);
 	SysFreeString(x);  
	return  x;
}
</code></pre>
<p>3. C++ DLL (.h):</p>
<pre><code class="language-cpp">WIN32DLL02_API BSTR fnWin32DLL02(BSTR);
</code></pre>
<p>Hoffe Ihr könnt mir da weiterhelfen.<br />
Vielen Dank für Eure Hilfe.<br />
ShadowEater <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1430995</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1430995</guid><dc:creator><![CDATA[ShadowEater]]></dc:creator><pubDate>Sat, 05 Jan 2008 10:54:17 GMT</pubDate></item><item><title><![CDATA[Reply to Übergabe eines VB - Strings an eine C++ Win32Dll on Sat, 05 Jan 2008 13:16:18 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-8.html" rel="nofollow">Rund um die Programmierung</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1431090</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1431090</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sat, 05 Jan 2008 13:16:18 GMT</pubDate></item></channel></rss>