<?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[Probleme mit Wrapper - DLL]]></title><description><![CDATA[<p>Ich habe mir eine Wrapper Dll für eine Siemens Dll geschrieben um die Kommunikation mit einer SPS zu beobachten, da habe Ich 2 Funktionen durch meine ersetzt!</p>
<p>Das Problem ist das die Funktion SCP_open was loggt, nur die SCP_send schreibt nichts aus dem char* array c in das textfile.</p>
<p>Was mache Ich falsch?</p>
<pre><code class="language-cpp">// SCP_open
extern &quot;C&quot; int __stdcall __E__9__(char* a)
	{

	 FILE* datei;
	 datei = fopen(&quot;c:\\log.txt&quot;,&quot;a&quot;);
	 fprintf(datei,&quot;open: %s\r\n&quot;,a);
	 fclose(datei);

     typedef int (__stdcall *pS)(char*);
     pS pps = (pS)p[9];
     int rv = pps(a);

     return rv;
	}

// SCP_send
extern &quot;C&quot; int __stdcall __E__13__(int a, UWORD b, const  char* c)
	{

	 FILE* datei;
	 datei = fopen(&quot;c:\\log.txt&quot;,&quot;a&quot;);
	 fprintf(datei,&quot;send: len: %i zeichen: %s\r\n&quot;,b,c);

	 fclose(datei);

     typedef int (__stdcall *pS)(int, UWORD, char*);
     pS pps = (pS)p[13];
     int rv = pps(a, b, c);

     return rv;
	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/267237/probleme-mit-wrapper-dll</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 14:26:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/267237.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 May 2010 18:58:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit Wrapper - DLL on Fri, 21 May 2010 08:56:01 GMT]]></title><description><![CDATA[<p>Ich habe mir eine Wrapper Dll für eine Siemens Dll geschrieben um die Kommunikation mit einer SPS zu beobachten, da habe Ich 2 Funktionen durch meine ersetzt!</p>
<p>Das Problem ist das die Funktion SCP_open was loggt, nur die SCP_send schreibt nichts aus dem char* array c in das textfile.</p>
<p>Was mache Ich falsch?</p>
<pre><code class="language-cpp">// SCP_open
extern &quot;C&quot; int __stdcall __E__9__(char* a)
	{

	 FILE* datei;
	 datei = fopen(&quot;c:\\log.txt&quot;,&quot;a&quot;);
	 fprintf(datei,&quot;open: %s\r\n&quot;,a);
	 fclose(datei);

     typedef int (__stdcall *pS)(char*);
     pS pps = (pS)p[9];
     int rv = pps(a);

     return rv;
	}

// SCP_send
extern &quot;C&quot; int __stdcall __E__13__(int a, UWORD b, const  char* c)
	{

	 FILE* datei;
	 datei = fopen(&quot;c:\\log.txt&quot;,&quot;a&quot;);
	 fprintf(datei,&quot;send: len: %i zeichen: %s\r\n&quot;,b,c);

	 fclose(datei);

     typedef int (__stdcall *pS)(int, UWORD, char*);
     pS pps = (pS)p[13];
     int rv = pps(a, b, c);

     return rv;
	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1900393</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1900393</guid><dc:creator><![CDATA[jogibear9988]]></dc:creator><pubDate>Fri, 21 May 2010 08:56:01 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Wrapper - DLL on Thu, 20 May 2010 19:19:57 GMT]]></title><description><![CDATA[<p>Da lässt sich so spontan nichts erkennen. Geh mal mit einem Debugger durch oder mach ein paar Debug-Ausgaben in SCP_send. Entweder wird die Funktion gar nicht aufgerufen oder es kann die Datei nicht geöffnet werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1900407</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1900407</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 20 May 2010 19:19:57 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Wrapper - DLL on Fri, 21 May 2010 08:56:45 GMT]]></title><description><![CDATA[<p>nee, er schreibt in scp_send schon auch was in die datei, nur nicht das was ich an scp_send übergebe!</p>
<p>Ich glaube das problem ist das in der struct auch 0 end drin sein können.</p>
<p>drum hab ichs dann so gemacht:<br />
(in parameter b steht die länge!)</p>
<pre><code class="language-cpp">// SCP_send
extern &quot;C&quot; int __stdcall __E__13__(int a, UWORD b, const  char* c)
	{

	 FILE* datei;
	 datei = fopen(&quot;c:\\log.txt&quot;,&quot;a&quot;);
	 fprintf(datei,&quot;send: len: %i zeichen: &quot;,b);
	 char *g=c;
	 for (int i=0;i&lt;b;i++)
	 {
		fprintf(datei,&quot;%c (%i)&quot;,*g,*g);
		g++;
	 }
	 fprintf(datei,&quot;\r\n&quot;,b);

	 fclose(datei);

     typedef int (__stdcall *pS)(int, UWORD, char*);
     pS pps = (pS)p[13];
     int rv = pps(a, b, c);

     ret
</code></pre>
<p>geht aber irgendwie auch nicht...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1900430</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1900430</guid><dc:creator><![CDATA[jogibear9988]]></dc:creator><pubDate>Fri, 21 May 2010 08:56:45 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Wrapper - DLL on Fri, 21 May 2010 07:33:09 GMT]]></title><description><![CDATA[<p>also, die werte welche an a und b übergeben werden scheinen zus timmen, auch die software welche meinen wrapper benutzt scheint noch zu komunizieren, nur das was ich in mein textfile schreibe scheint falsch zu sein...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1900555</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1900555</guid><dc:creator><![CDATA[jogibear9988]]></dc:creator><pubDate>Fri, 21 May 2010 07:33:09 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Wrapper - DLL on Fri, 21 May 2010 09:03:49 GMT]]></title><description><![CDATA[<p>Ich hab dir mal eine Handvoll cpp-Tags spendiert, demnächst bitte selber machen <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>
<p>Bist du sicher dass du im richtigen Forum bist? Das ist purer C-Code. Grade das Gefrickel mit den Funktionspointern und den C-casts aus dem p-Array raus (wo ist das überhaupt definiert?) sorgen bei mir grad für aufgerollte Fußnägel und schrillende Alarmglocken - du hast überhaupt keine Typsicherheit und da kann so in etwa alles mögliche passieren.</p>
<p>Wie schon beschrieben wurde, hockst du dich am besten mit dem Debugger drauf und gehst schritt für schritt den Code durch und überprüfst ob er tut was du erwartest - bzw. ab wo er das nicht mehr tut.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1900609</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1900609</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Fri, 21 May 2010 09:03:49 GMT</pubDate></item></channel></rss>