<?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[convert jstring to LPCOLESTR]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich bin ein absoluter Neuling und habe meine Mühe und Not mit der Verarbeitung von Strings in C++.</p>
<p>Ich habe folgendes Problem:</p>
<p>Ich erhalte über das JNI einen jstring. Dieser beinhaltet den Pfad einer Datei, die ich erstellen möchte. Die Funktion &quot;SetOutputFileName&quot; benötigt allerdings, wenn ich das richtig verstehe, einen String vom Typ LPCOLESTR. Ich habe leider keine Ahnung, wie ich die Konvertierung vollziehen muss. Kann mir aber nicht vorstellen, dass das so schwer ist.</p>
<p>Ich hoffe ich konnte mich verständlich machen können und freue mich über jede Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/184734/convert-jstring-to-lpcolestr</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Jul 2026 21:42:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/184734.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Jun 2007 17:03:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to convert jstring to LPCOLESTR on Mon, 18 Jun 2007 17:03:21 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich bin ein absoluter Neuling und habe meine Mühe und Not mit der Verarbeitung von Strings in C++.</p>
<p>Ich habe folgendes Problem:</p>
<p>Ich erhalte über das JNI einen jstring. Dieser beinhaltet den Pfad einer Datei, die ich erstellen möchte. Die Funktion &quot;SetOutputFileName&quot; benötigt allerdings, wenn ich das richtig verstehe, einen String vom Typ LPCOLESTR. Ich habe leider keine Ahnung, wie ich die Konvertierung vollziehen muss. Kann mir aber nicht vorstellen, dass das so schwer ist.</p>
<p>Ich hoffe ich konnte mich verständlich machen können und freue mich über jede Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1308553</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1308553</guid><dc:creator><![CDATA[Life76]]></dc:creator><pubDate>Mon, 18 Jun 2007 17:03:21 GMT</pubDate></item><item><title><![CDATA[Reply to convert jstring to LPCOLESTR on Tue, 19 Jun 2007 11:54:06 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-4.html" rel="nofollow">WinAPI</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/1309050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309050</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Tue, 19 Jun 2007 11:54:06 GMT</pubDate></item><item><title><![CDATA[Reply to convert jstring to LPCOLESTR on Tue, 19 Jun 2007 12:59:32 GMT]]></title><description><![CDATA[<p>Verwende T2OLE, bzw. A2OLE, bzw. W2OLE...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309138</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309138</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 19 Jun 2007 12:59:32 GMT</pubDate></item><item><title><![CDATA[Reply to convert jstring to LPCOLESTR on Tue, 19 Jun 2007 15:09:06 GMT]]></title><description><![CDATA[<p>Hm, damit kann ich leider nichts anfangen. Hab die Begriffe mal bei Google eingegeben. Kann es sein, dass ich dafür besondere Include-Dateien brauche?</p>
<p>Vielleicht ist es besser, wenn ich mal den Code schreibe.</p>
<p>Also, die Nativ-Funktion, die via Java aufgerufen wird lautet:</p>
<p>JNIEXPORT void JNICALL Java_cmToolkit_cmEasyVideoRecorderJNI_startMovie(JNIEnv *env, jclass clazz, jstring jpath )<br />
{<br />
return;<br />
}</p>
<p>Nun habe ich vor, mit &quot;jpath&quot;(welches den Pfad der Datei beinhaltet) die C-Funktion &quot;SetOutputFileName&quot; auszuführen. Ich habe es einfach so mal versucht:</p>
<p>JNIEXPORT void JNICALL Java_cmToolkit_cmEasyVideoRecorderJNI_startMovie(JNIEnv *env, jclass clazz, jstring jpath )<br />
{<br />
char cpath = (char) jpath;<br />
LPCOLESTR lcpath = (LPCOLESTR)cpath;<br />
m_pCapture-&gt;SetOutputFileName(&amp;MEDIASUBTYPE_Avi,lcpath,&amp;pMux<br />
, &amp;pSink);<br />
return;<br />
}</p>
<p>Aber das funktioniert leider nicht. Mit folgendem Code läufts:</p>
<p>JNIEXPORT void JNICALL Java_cmToolkit_cmEasyVideoRecorderJNI_startMovie(JNIEnv *env, jclass clazz, jstring jpath )<br />
{<br />
m_pCapture-&gt;SetOutputFileName(&amp;MEDIASUBTYPE_Avi,L&quot;C:\\Beispi<br />
el.avi&quot;,&amp;pMux, &amp;pSink);<br />
return;<br />
}</p>
<p>Aber das bringt mir nichts, weil ich den Pfad eben über ne Variable steuern will.</p>
<p>Danke schon mal, für deine Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309228</guid><dc:creator><![CDATA[Life76]]></dc:creator><pubDate>Tue, 19 Jun 2007 15:09:06 GMT</pubDate></item></channel></rss>