<?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[Datenübergabe an AktiveX-Control]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich muß im Rahmen meiner Diplomarbeit ein Programm zur Steuerung eines Lock-In Verstärkers schreiben. Vom Hersteller hab ich ein AktiveX Control bekommen. Dieses habe ich schon in den Borland Builder 6 eingebunden. Da ich Neuling in der Programmierung bin, weis ich aber nicht, wie ich die Mitgelieferten Funktionen/Methoden des AktiveX-Controls bedienen muß.</p>
<p>hier mal ein Beispiel einer Funktion:</p>
<pre><code class="language-cpp">short WriteReadSRInstrument (short nInstrumentNumber, BSTR sCommand, VARIANT* sResponse, VARIANT* VREsponseArray, VARIANT* nStatusByte)
</code></pre>
<p>InstrumentNumber ist einfach ein Integer, das ist kein Problem; als sCommand will das Gerät einen String wie z.B. &quot;ID&quot;, hier fangen schon die Probleme an.. es will wchar_t , wenn ich dann eine Variable so definiere kommt eine Fehlermeldung wie &quot;can't convert wchar_t into wchar_t*&quot; .. ???? was will mir der Builder da sagen? kenn mich mit Zeigern nicht aus, warum schluckt das Teil nicht auch &quot;normale&quot; Variablen?</p>
<p>was VARIANT* soll hab ich nicht verstanden, da war die Hilfefunktion nicht sehr hilfreich..</p>
<p>hier mal mein Quellcode:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;ULockIn1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link &quot;SRINSTCOMMSLib_OCX&quot;
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{

        if(!SRInstComms1-&gt;VerifyConnections()) Memo1-&gt;Lines-&gt;Add(&quot;es funktioniert&quot;); //Test ob Gerät funktioniert
        SRInstComms1-&gt;OpenSRComms(0);    //Instrument 0 öffnen
        SRInstComms1-&gt;WriteReadSRInstrument();   //lesen bzw. schreiben auf Gerät
        SRInstComms1-&gt;CloseSRComms(0);  //Instrument 0 schließen
}
//---------------------------------------------------------------------------
</code></pre>
<p>es funktioniert alles, nur mit &quot;WriteReadSRInstrument( ) kann ich nicht umgehen..</p>
<p>Vielleicht kann ja jemand von Euch was mit der obigen Funktionsbeschreibung anfangen..</p>
<p>Vielen Dank!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/90322/datenübergabe-an-aktivex-control</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Jul 2026 18:37:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/90322.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Oct 2004 10:54:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datenübergabe an AktiveX-Control on Thu, 28 Oct 2004 13:54:54 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich muß im Rahmen meiner Diplomarbeit ein Programm zur Steuerung eines Lock-In Verstärkers schreiben. Vom Hersteller hab ich ein AktiveX Control bekommen. Dieses habe ich schon in den Borland Builder 6 eingebunden. Da ich Neuling in der Programmierung bin, weis ich aber nicht, wie ich die Mitgelieferten Funktionen/Methoden des AktiveX-Controls bedienen muß.</p>
<p>hier mal ein Beispiel einer Funktion:</p>
<pre><code class="language-cpp">short WriteReadSRInstrument (short nInstrumentNumber, BSTR sCommand, VARIANT* sResponse, VARIANT* VREsponseArray, VARIANT* nStatusByte)
</code></pre>
<p>InstrumentNumber ist einfach ein Integer, das ist kein Problem; als sCommand will das Gerät einen String wie z.B. &quot;ID&quot;, hier fangen schon die Probleme an.. es will wchar_t , wenn ich dann eine Variable so definiere kommt eine Fehlermeldung wie &quot;can't convert wchar_t into wchar_t*&quot; .. ???? was will mir der Builder da sagen? kenn mich mit Zeigern nicht aus, warum schluckt das Teil nicht auch &quot;normale&quot; Variablen?</p>
<p>was VARIANT* soll hab ich nicht verstanden, da war die Hilfefunktion nicht sehr hilfreich..</p>
<p>hier mal mein Quellcode:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;ULockIn1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link &quot;SRINSTCOMMSLib_OCX&quot;
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{

        if(!SRInstComms1-&gt;VerifyConnections()) Memo1-&gt;Lines-&gt;Add(&quot;es funktioniert&quot;); //Test ob Gerät funktioniert
        SRInstComms1-&gt;OpenSRComms(0);    //Instrument 0 öffnen
        SRInstComms1-&gt;WriteReadSRInstrument();   //lesen bzw. schreiben auf Gerät
        SRInstComms1-&gt;CloseSRComms(0);  //Instrument 0 schließen
}
//---------------------------------------------------------------------------
</code></pre>
<p>es funktioniert alles, nur mit &quot;WriteReadSRInstrument( ) kann ich nicht umgehen..</p>
<p>Vielleicht kann ja jemand von Euch was mit der obigen Funktionsbeschreibung anfangen..</p>
<p>Vielen Dank!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/639297</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/639297</guid><dc:creator><![CDATA[Zeon1001]]></dc:creator><pubDate>Thu, 28 Oct 2004 13:54:54 GMT</pubDate></item><item><title><![CDATA[Reply to Datenübergabe an AktiveX-Control on Thu, 28 Oct 2004 13:06:19 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>vermutlich heisst die Fehlermeldung nicht</p>
<blockquote>
<p>can't convert wchar_t into wchar_t&quot;..</p>
</blockquote>
<p>sondern</p>
<p>can't convert wchar_t into wchar_t*<br />
oder<br />
can't convert wchar_t* into wchar_t</p>
<p>und dann solltest du schon draufkommen was da gemeint ist</p>
<p>MfG<br />
Klaus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/639465</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/639465</guid><dc:creator><![CDATA[KlausB]]></dc:creator><pubDate>Thu, 28 Oct 2004 13:06:19 GMT</pubDate></item><item><title><![CDATA[Reply to Datenübergabe an AktiveX-Control on Thu, 28 Oct 2004 13:56:15 GMT]]></title><description><![CDATA[<p>war ein Schreibfehler meinerseits..</p>
<p>was ist denn der Unterschied zwischen &quot;tagVariant*&quot; und &quot;Variant*&quot; ? Variant* kennt mein Builder ja noch, das komische Gerät will allerdings tagVariant* ..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/639522</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/639522</guid><dc:creator><![CDATA[Zeon1001]]></dc:creator><pubDate>Thu, 28 Oct 2004 13:56:15 GMT</pubDate></item><item><title><![CDATA[Reply to Datenübergabe an AktiveX-Control on Thu, 28 Oct 2004 14:31:48 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>schau mal in der msdn nach, glaub da hab ich schon mal was drüber gesehen!</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/639563</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/639563</guid><dc:creator><![CDATA[xDannyOx]]></dc:creator><pubDate>Thu, 28 Oct 2004 14:31:48 GMT</pubDate></item></channel></rss>