<?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[VARIANT Datentyp????]]></title><description><![CDATA[<p>Hi<br />
Ich sitze gerade an einer Applikation, die ich mit MFC unter VS2005 schreibe. Diese soll &quot;SocketWrench&quot; verwenden, und ich konnte das COM Element auch soweit in meine Form hineinziehen und kann es auch ansprechen. ich habe dem Element, das ich in die Form gezogen habe eine Member-Variable gegeben und kann nun über diese Variable z.B. eingeben:<br />
m_SocketWrench1.connect(); und hier ist auch schon mein Problem:<br />
Das sagt die Hilfe:</p>
<pre><code>Connect Method  

 Establish a connection with a remote server.

Syntax

object.Connect( [RemoteAddress], [RemotePort], [Protocol], [Timeout], [Options], [LocalAddress], [LocalPort] )

Remarks

This method establishes a network connection with a remote server. All arguments are optional. If a given argument is missing, then a corresponding property or properties must be set before attempting the connection, as follows:

RemoteAddress, which may be a hostname or IP address, defaults to the value of the HostAddress property if it is defined. Otherwise, it defaults to the value of the HostName property.

RemotePort specifies the port number that the server is using to listen for connections. If this argument is not specified, the value of the RemotePort property will be used as the default.

Protocol specifies the protocol that should be used when establishing the connection. If this argument is not specified, the value of the Protocol property will be used as the default. One of the following values may be used: 

Value Constant Description 
6 swProtocolTcp Specifies the Transmission Control Protocol. This protocol provides a reliable, bi-directional byte stream. This is the default protocol. 
17 swProtocolUdp Specifies the User Datagram Protocol. This protocol is message oriented, sending data in discrete packets. Note that UDP is unreliable in that there is no way for the sender to know that the receiver has actually received the datagram. 

Timeout specifies the amount of time until a blocking operation fails. A value of zero indicates that the control should wait indefinitely for the operation to complete. If this argument is not specified, the value of the Timeout property will be used as the default.

Options specifies one or more socket options which are to be used when establishing the connection. The value is created by combining the options using a bitwise Or operator. Note that if this argument is specified, it will override any property values that are related to that option.

Value Constant Description  
1 swOptionBroadcast This option specifies that broadcasting should be enabled for datagrams. This option is invalid for stream sockets. 
2 swOptionDontRoute This option specifies default routing should not be used. This option should not be specified unless absolutely necessary. 
4 swOptionKeepAlive This option specifies that packets are to be sent to the remote system when no data is being exchanged to keep the connection active. This option is only valid for stream sockets. 
8 swOptionReuseAddress This option specifies that the local address can be reused. This option is commonly used by server applications. 
16 swOptionNoDelay This option disables the Nagle algorithm, which buffers unacknowledged data and insures that a full-size packet can be sent to the remote host. 
32 swOptionInLine This option specifies that out-of-band data should be received inline with the standard data stream. This option is only valid for stream sockets. 
&amp;H10000000 swOptionSecure This option specifies that a secure SSL connection is to be negotiated and established. 

LocalAddress specifies the local IP address of the network adapter that the control should use when establishing the connection. If this argument is not specified, the control will bind to any suitable adapter on the local system. Using a specific local address when establishing a TCP connection is not recommended.

LocalPort specifies the local port number that the control should use when establishing the connection. If this argument is not specified, an appropriate local port number will be assigned for the connection. Using a specific local port number when establishing a TCP connection is not recommended.

Return Value

A value of zero is returned if the connection was successful. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

See Also

HostAddress Property, HostName Property, RemotePort Property, RemoteService Property, Disconnect Method, Broadcast Property, Route Property, KeepAlive Property, ReuseAddress Property, NoDelay Property, InLine Property, Secure Property
</code></pre>
<p>Befehl:<br />
m_socketWrench1.Connect(&quot;<a href="http://www.google.de" rel="nofollow">www.google.de</a>&quot;,80,6,10, NULL, NULL, NULL);</p>
<p>Das Tutorial zu dem Modul sagt aber .Connect reicht mit 2 Parametern, den Rest nimmt es default-werte, aber bei mir sagt der Compiler sinngemäß ich muss 6 werte eingeben und die URL am Anfang kann er nicht in einen VARIANT Typen konvertieren.<br />
Wie wandel ich das Char-Array in einen VARIANT um?!<br />
Liebe Grüße<br />
Basti</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/199695/variant-datentyp</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Apr 2026 12:24:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/199695.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Dec 2007 09:31:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to VARIANT Datentyp???? on Thu, 06 Dec 2007 09:55:12 GMT]]></title><description><![CDATA[<p>Hi<br />
Ich sitze gerade an einer Applikation, die ich mit MFC unter VS2005 schreibe. Diese soll &quot;SocketWrench&quot; verwenden, und ich konnte das COM Element auch soweit in meine Form hineinziehen und kann es auch ansprechen. ich habe dem Element, das ich in die Form gezogen habe eine Member-Variable gegeben und kann nun über diese Variable z.B. eingeben:<br />
m_SocketWrench1.connect(); und hier ist auch schon mein Problem:<br />
Das sagt die Hilfe:</p>
<pre><code>Connect Method  

 Establish a connection with a remote server.

Syntax

object.Connect( [RemoteAddress], [RemotePort], [Protocol], [Timeout], [Options], [LocalAddress], [LocalPort] )

Remarks

This method establishes a network connection with a remote server. All arguments are optional. If a given argument is missing, then a corresponding property or properties must be set before attempting the connection, as follows:

RemoteAddress, which may be a hostname or IP address, defaults to the value of the HostAddress property if it is defined. Otherwise, it defaults to the value of the HostName property.

RemotePort specifies the port number that the server is using to listen for connections. If this argument is not specified, the value of the RemotePort property will be used as the default.

Protocol specifies the protocol that should be used when establishing the connection. If this argument is not specified, the value of the Protocol property will be used as the default. One of the following values may be used: 

Value Constant Description 
6 swProtocolTcp Specifies the Transmission Control Protocol. This protocol provides a reliable, bi-directional byte stream. This is the default protocol. 
17 swProtocolUdp Specifies the User Datagram Protocol. This protocol is message oriented, sending data in discrete packets. Note that UDP is unreliable in that there is no way for the sender to know that the receiver has actually received the datagram. 

Timeout specifies the amount of time until a blocking operation fails. A value of zero indicates that the control should wait indefinitely for the operation to complete. If this argument is not specified, the value of the Timeout property will be used as the default.

Options specifies one or more socket options which are to be used when establishing the connection. The value is created by combining the options using a bitwise Or operator. Note that if this argument is specified, it will override any property values that are related to that option.

Value Constant Description  
1 swOptionBroadcast This option specifies that broadcasting should be enabled for datagrams. This option is invalid for stream sockets. 
2 swOptionDontRoute This option specifies default routing should not be used. This option should not be specified unless absolutely necessary. 
4 swOptionKeepAlive This option specifies that packets are to be sent to the remote system when no data is being exchanged to keep the connection active. This option is only valid for stream sockets. 
8 swOptionReuseAddress This option specifies that the local address can be reused. This option is commonly used by server applications. 
16 swOptionNoDelay This option disables the Nagle algorithm, which buffers unacknowledged data and insures that a full-size packet can be sent to the remote host. 
32 swOptionInLine This option specifies that out-of-band data should be received inline with the standard data stream. This option is only valid for stream sockets. 
&amp;H10000000 swOptionSecure This option specifies that a secure SSL connection is to be negotiated and established. 

LocalAddress specifies the local IP address of the network adapter that the control should use when establishing the connection. If this argument is not specified, the control will bind to any suitable adapter on the local system. Using a specific local address when establishing a TCP connection is not recommended.

LocalPort specifies the local port number that the control should use when establishing the connection. If this argument is not specified, an appropriate local port number will be assigned for the connection. Using a specific local port number when establishing a TCP connection is not recommended.

Return Value

A value of zero is returned if the connection was successful. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

See Also

HostAddress Property, HostName Property, RemotePort Property, RemoteService Property, Disconnect Method, Broadcast Property, Route Property, KeepAlive Property, ReuseAddress Property, NoDelay Property, InLine Property, Secure Property
</code></pre>
<p>Befehl:<br />
m_socketWrench1.Connect(&quot;<a href="http://www.google.de" rel="nofollow">www.google.de</a>&quot;,80,6,10, NULL, NULL, NULL);</p>
<p>Das Tutorial zu dem Modul sagt aber .Connect reicht mit 2 Parametern, den Rest nimmt es default-werte, aber bei mir sagt der Compiler sinngemäß ich muss 6 werte eingeben und die URL am Anfang kann er nicht in einen VARIANT Typen konvertieren.<br />
Wie wandel ich das Char-Array in einen VARIANT um?!<br />
Liebe Grüße<br />
Basti</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1415668</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1415668</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Thu, 06 Dec 2007 09:55:12 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Thu, 06 Dec 2007 11:15:21 GMT]]></title><description><![CDATA[<p>Vl. hilft dir das weiter:</p>
<pre><code class="language-cpp">TCHAR chTmp[MAX_PATH] = _T(&quot;http://www.google.at&quot;);

COleVariant varURL(chTmp);
</code></pre>
<p>varURL müsstest du nun an deine Funktion übergeben können.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1415739</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1415739</guid><dc:creator><![CDATA[MP]]></dc:creator><pubDate>Thu, 06 Dec 2007 11:15:21 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Thu, 06 Dec 2007 11:35:33 GMT]]></title><description><![CDATA[<p>Ein String in einem Varient ist ein BSTR!<br />
Das einfachste Du verwendest einfach: CComBSTR(&quot;meinurl&quot;)</p>
<p>Default Werte darfsz Du nicht als NULL übergeben. Du musst die Notation von COM verwenden, in diesem Fal ein VARAINT vom Typ VT_ERROR mit scode==DISP_E_PARAMNOTFOUND!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1415754</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1415754</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 06 Dec 2007 11:35:33 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Thu, 06 Dec 2007 12:54:00 GMT]]></title><description><![CDATA[<p>ich habe es jetzt mal testweise so gemacht:</p>
<pre><code>TCHAR chUrl[MAX_PATH] = _T(&quot;10.64.1.22&quot;);
   TCHAR chPort[MAX_PATH] = _T(&quot;21&quot;);
   TCHAR chProto[MAX_PATH] = _T(&quot;6&quot;);
   TCHAR chTimeout[MAX_PATH] = _T(&quot;10&quot;);
   TCHAR chOptions[MAX_PATH] = _T(&quot;0&quot;);
   TCHAR chLocalAdress[MAX_PATH] = _T(&quot;0&quot;);
   TCHAR chLocalPort[MAX_PATH] = _T(&quot;0&quot;);
.....
COleVariant varURL(chUrl);
         COleVariant varPORT(chPort);
         COleVariant varPROTO(chProto);
         COleVariant varTIMEOUT(chTimeout);
         COleVariant varOPTIONS(chOptions);
         COleVariant varLOCALADRESS(chLocalAdress);
         COleVariant varLOCALPORT(chLocalPort);
         m_SocketWrench2.Connect(varURL,varPORT,varPROTO,varTIMEOUT,varOPTIONS,varLOCALADRESS,varLOCALPORT);
.........
void CWrenchServerDlg::OnConnectSocketwrench4()
{
   MessageBox(_T(&quot;Wonderful&quot;),_T(&quot;success&quot;),MB_OK);
}
</code></pre>
<p>Kann ich da statt MAX_PATH einfach die Byte-Anzahl eingeben, die ich brauche um die Variable darin zu speichern, und muss ich das &quot;\0&quot; mitberechnen?</p>
<p>Danke für die Hilfe bisher <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1415810</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1415810</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Thu, 06 Dec 2007 12:54:00 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Thu, 06 Dec 2007 13:14:25 GMT]]></title><description><![CDATA[<p>Du musst gar keine maximale Länge angeben. Die Daten werden sowieso intern kopiert.<br />
Warum machst Du es nicht gleich so:</p>
<pre><code class="language-cpp">m_SocketWrench2.Connect(COleVariant(_T(&quot;10.64.1.22&quot;)),COleVariant(_T(&quot;21&quot;)),COleVariant(_T(&quot;6&quot;)),...);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1415828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1415828</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 06 Dec 2007 13:14:25 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Thu, 06 Dec 2007 13:19:58 GMT]]></title><description><![CDATA[<p>stimmt, hast recht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Habe nicht auf Anhieb verstanden was der Code macht, also dieses COleVariant</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1415834</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1415834</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Thu, 06 Dec 2007 13:19:58 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Thu, 06 Dec 2007 14:46:09 GMT]]></title><description><![CDATA[<p>Es kapselt einen VARIANT und sorgt auch dafür, dass dessen interner Speicher freigegeben wird. Und es hat entsprechende typsichere Konstruktoren...</p>
<p>Ich bevorzuge CCoVariant, ist aber Geschmacksache.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1415912</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1415912</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 06 Dec 2007 14:46:09 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 07:08:20 GMT]]></title><description><![CDATA[<p>Der Tipp mit dem VT_ERROR kam mir wie gerufen!</p>
<blockquote>
<p>Es kapselt einen VARIANT ...</p>
</blockquote>
<p>Ja das dachte ich bisher auch. Aber es muss trotzdem Unterschiede geben.</p>
<p>Verwende ich bei meiner WordAutomation die COleVariant funktioniert es nur mit den Original-Klassen aus der TypeLibrary. In meiner abgeleiteten Automations-Klasse bekomme ich die</p>
<blockquote>
<p>COleException: scode = severity: SEVERITY_ERROR, facility: FACILITY_NULL ($C0000005).</p>
</blockquote>
<p>Zu Deutsch &quot;Keine Fehlermeldung verfügbar&quot;<br />
Nehme ich dort VARIANT geht alles. Aber es ist mir echt zu mühsam, für jeden der zig Parameter den entsprechenden VARIANT zu bilden.</p>
<p>Weiß jemand, woran es liegen kann, dass VARIANT aber nicht COleVariant funktioniert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416252</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416252</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 07 Dec 2007 07:08:20 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 07:16:29 GMT]]></title><description><![CDATA[<p>Wahrscheinlich werden nicht die korrekten Typen gebildet und Du verwendest evtl. falsche KOnstruktoren.<br />
Zeig mal Code wie Du die VARIANTs baust und wie Du das mit COleVariant machst.<br />
BTW: Ich mag CComVariant lieber...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416255</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 07 Dec 2007 07:16:29 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 08:20:16 GMT]]></title><description><![CDATA[<p>also ich habe mir die ganze Sache jetzt mal ein wenig betrachtet.<br />
Habe nun folgenden Code und versuche so ein bisschen mit dem ActiveX Modul rumzuspielen und will das irgendwan mal verstehen *g*</p>
<pre><code>void CWrenchServerDlg::OnErrorSocketwrench4(const VARIANT&amp; ErrorCode, const VARIANT&amp; Description)
{
	CComVariant Err_Code = ErrorCode;
	CComVariant Err_Descr = Description;
	CComBSTR* teststring;

	BstrFromVector(teststring, ErrorCode);

	MessageBox(_T(&quot;hier die description&quot;),_T(&quot;hier der errorcode&quot;),MB_OK);

}
</code></pre>
<p>Will im Prinzip aus dem Eventhandler Errorcode und Description ausgeben. Aber so ganz steig ich noch nicht durch. beim aktuellen Code kommt</p>
<p>Fehler 1 error C2664: 'BstrFromVector': Konvertierung des Parameters 1 von 'ATL::CComBSTR *' in 'SAFEARRAY *' nicht möglich c:\dokumente und einstellungen\basti\eigene dateien\visual studio 2005\projects\wrenchserver\wrenchserver\wrenchserverdlg.cpp 216</p>
<p>Und was ist ein &quot;Event sink&quot;? Und hat jmd. evtl. nen guten Link zu nem Text der sich mit COM Programmierung befasst, weil ich nicht UNBEDINGT auf die SocketWrench API zurückgreifen möchte.<br />
Liebe Grüße und Danke für die Hilfe<br />
Basti</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416275</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416275</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Fri, 07 Dec 2007 08:20:16 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 11:42:16 GMT]]></title><description><![CDATA[<blockquote>
<p>Wahrscheinlich werden nicht die korrekten Typen gebildet und Du verwendest evtl. falsche Konstruktoren.</p>
</blockquote>
<p>Komplizierte Datentypen habe ich (zumindes im Open) gar nicht drin.</p>
<p>Edit: ich nehm das mal hier raus. Hat ja nichts mit der Ursprungsfrage zu tun.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416394</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 07 Dec 2007 11:42:16 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 10:58:59 GMT]]></title><description><![CDATA[<p>Dieser Code ist Irrsinn!</p>
<pre><code class="language-cpp">EigeneWordDocuments doc = wordApp-&gt;get_Documents());
    doc.Open(LPCTSTR(docName));
</code></pre>
<p>Wie kannst Du einen LPDISPTACH Zeiger als LPCTSTR casten?<br />
Welchen Sinn soll das haben?</p>
<p>Das umkopieren in einen neuen VARIANT ob nun CComVaiant oder COleVarient nützt nichts.<br />
Du musst entsprechende dem Typ in dem Variant Deine nachricht anzeigen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416407</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416407</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 07 Dec 2007 10:58:59 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 11:07:33 GMT]]></title><description><![CDATA[<blockquote>
<p>Wie kannst Du einen LPDISPTACH Zeiger als LPCTSTR casten?</p>
</blockquote>
<p>Wieso? docName ist ein const char *</p>
<blockquote>
<p>Du musst entsprechende dem Typ in dem Variant Deine nachricht anzeigen.</p>
</blockquote>
<p>Wie meinst Du dass?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416413</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416413</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 07 Dec 2007 11:07:33 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 11:05:06 GMT]]></title><description><![CDATA[<p>Hmm... mir erschliesst sich leider noch nicht genau wie mir das hilft, kann es vllt. genauer erläutern was geschehen muss und den Code erklären?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416414</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416414</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Fri, 07 Dec 2007 11:05:06 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 11:12:59 GMT]]></title><description><![CDATA[<p>Sorry wegen docName! Habe ich irgendwie überlesen.<br />
Aber warum castest Du dann bitte?<br />
Meide casts, wenn ein cast nötig ist überlege 3mal warum!</p>
<p>Hast Du Dir mal angesehen, was ein VARIANT ist?<br />
Ein VARIANT ist variant, d.h. er kann ein INT enthalten einen BSTR, ein LONG ein BYTE, ein Array...</p>
<p>Du musst also entsprechende des Typs im VARIANT reagieren, oder den Typ umwandeln in das was Du möchest VariantChangeType!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416419</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416419</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 07 Dec 2007 11:12:59 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 11:22:35 GMT]]></title><description><![CDATA[<p>Sebastian, hast recht, dir hilft das sicher nicht weiter.</p>
<p>Mein Problem ist, man hat mir fertigen Uralt-Quellcode vorgesetzt, den ich nun anpassen und erweitern muss. Momentan kämpfe ich mit den OLE-Grundlagen und habe dies hier beim Suchen nach COleVariant gefunden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416420</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416420</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 07 Dec 2007 11:22:35 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 11:28:01 GMT]]></title><description><![CDATA[<blockquote>
<p>Aber warum castest Du dann bitte</p>
</blockquote>
<p>Ach frag mich nicht (s. letzten Beitrag).</p>
<blockquote>
<p>Du musst also entsprechende des Typs im VARIANT reagieren</p>
</blockquote>
<p>Ich dachte, das hätte ich, zumindest mit dem VARIANT (varFalse.boolVal=false; varFile.bstrVal=...). Aber COleVariant ist mir immer noch schleierhaft. Na vielleicht habe ich' s bis Montag kapiert.</p>
<p>Ich klinke mich jetzt lieber aus und &quot;studiere&quot; erst mal Microsoft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416429</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416429</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 07 Dec 2007 11:28:01 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 11:33:18 GMT]]></title><description><![CDATA[<p>hehe okay, aber was muss ich jetzt an meinem Code ändern dass ich die 2 Daten in einer Messagebox ausgeben kann?! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Gruß Basti</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416437</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416437</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Fri, 07 Dec 2007 11:33:18 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 11:40:42 GMT]]></title><description><![CDATA[<p>Ich habs! Danke Martin für den Denkanstoß.</p>
<pre><code>COleVariant(docName)
</code></pre>
<p>wars. Manchmal ist man doch besch...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416441</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 07 Dec 2007 11:40:42 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 12:52:12 GMT]]></title><description><![CDATA[<p>sebastian87 schrieb:</p>
<blockquote>
<p>hehe okay, aber was muss ich jetzt an meinem Code ändern dass ich die 2 Daten in einer Messagebox ausgeben kann?! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Gruß Basti</p>
</blockquote>
<p>Was bekommst Du denn übergeben?<br />
Jetzt sag nicht VARIANTs... :xmas1:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1416487</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416487</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 07 Dec 2007 12:52:12 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Fri, 07 Dec 2007 13:08:16 GMT]]></title><description><![CDATA[<p>Naja im Prinzip wird an den Eventhandler OnError die 2 Variants übergeben die den errorcode und die description enthalten. Wie ich mit den Daten nun weiter verfahren muss um die wichtigen informationen auszulesen weis ich leider nicht und dummerweise auch nicht wie die generiert werden. hab einfach nur auf dem Dialogfeld rechtsklick auf das OCX gemacht und dan eben Eventhandler hinzufügen...:</p>
<pre><code>void CWrenchServerDlg::OnErrorSocketwrench4(const VARIANT&amp; ErrorCode, const VARIANT&amp; Description)
{
	CComVariant Err_Code = ErrorCode;
	CComVariant Err_Descr = Description;
	CComBSTR* teststring;

	BstrFromVector(teststring, ErrorCode);

	MessageBox(_T(&quot;hier die description&quot;),_T(&quot;hier der errorcode&quot;),MB_OK);

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1416503</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1416503</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Fri, 07 Dec 2007 13:08:16 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Mon, 10 Dec 2007 11:54:23 GMT]]></title><description><![CDATA[<p>Wenn du nichts weiter willst, als ErrorCode und Description in einer MessageBox anzuzeigen, musst du den vt Member überprüfen - er sagt dir, welchen Datentyp der Variant beinhaltet (siehe auch: <a href="http://msdn2.microsoft.com/en-us/library/ms221627.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms221627.aspx</a>)</p>
<p>Angenommen ErrorCode ist vom Typ int, dann könnte das ganze so aussehen:</p>
<pre><code class="language-cpp">CComVariant Err_Code = ErrorCode;
CComVariant Err_Descr = Description;
CComBSTR* teststring;
CString strDescription, strErrorCode;

BstrFromVector(teststring, ErrorCode);

if(Description.vt == VT_BSTR)
{
   strDescription.Format(_T(&quot;%S&quot;), Description.bstrVal);		
}

if(ErrorCode.vt == VT_INT)
{
    strErrorCode.Format(_T(&quot;%i&quot;), ErrorCode.intVal);
}

MessageBox(strDescription, strErrorCode, MB_OK);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1418047</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418047</guid><dc:creator><![CDATA[MP]]></dc:creator><pubDate>Mon, 10 Dec 2007 11:54:23 GMT</pubDate></item><item><title><![CDATA[Reply to VARIANT Datentyp???? on Mon, 10 Dec 2007 13:02:20 GMT]]></title><description><![CDATA[<p>Einfacher ist ein VariantChangeType (wie ich es scon schrieb) und dann direkt von dem entsprechenden Typ VT_BSTR auszugehen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418095</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418095</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 10 Dec 2007 13:02:20 GMT</pubDate></item></channel></rss>