<?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[Applikationsverzeichnis und Dateiname zusammenfügen]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich möchte aus einer Textdatei den Inhalt auslesen. Leider weiß ich nicht so genau wie ich den Pfad bekomme.</p>
<p>Bisher mache ich das so:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

char Line[9];

void GetMyOrientation( void )
{
  FILE *Ptr;
  CHAR szAppPath[255];
  char FName [255];
  char *result;
  int myPos = 0;

  GetModuleFileName(NULL,szAppPath,sizeof(szAppPath));
  result = strrchr(szAppPath, '/');
  myPos  = result - szAppPath + 1;
  if (result != NULL)
  {    
    strncpy(FName, szAppPath, myPos);
    lstrcat(FName,&quot;meinedatei.tmp_&quot;);
    Ptr = fopen(FName, &quot;r&quot;);
    gets(Line);
  }
  fclose(Ptr);
}
</code></pre>
<p>Aber irgendwie bekomme ich bei strrchr eine aufforderung zur Verzeichnisangabe von strrchr.asm.</p>
<p>Danke im Voraus &amp; Gruß,<br />
Moony</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/213225/applikationsverzeichnis-und-dateiname-zusammenfügen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 11:24:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/213225.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 May 2008 12:23:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Applikationsverzeichnis und Dateiname zusammenfügen on Thu, 15 May 2008 12:23:28 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich möchte aus einer Textdatei den Inhalt auslesen. Leider weiß ich nicht so genau wie ich den Pfad bekomme.</p>
<p>Bisher mache ich das so:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

char Line[9];

void GetMyOrientation( void )
{
  FILE *Ptr;
  CHAR szAppPath[255];
  char FName [255];
  char *result;
  int myPos = 0;

  GetModuleFileName(NULL,szAppPath,sizeof(szAppPath));
  result = strrchr(szAppPath, '/');
  myPos  = result - szAppPath + 1;
  if (result != NULL)
  {    
    strncpy(FName, szAppPath, myPos);
    lstrcat(FName,&quot;meinedatei.tmp_&quot;);
    Ptr = fopen(FName, &quot;r&quot;);
    gets(Line);
  }
  fclose(Ptr);
}
</code></pre>
<p>Aber irgendwie bekomme ich bei strrchr eine aufforderung zur Verzeichnisangabe von strrchr.asm.</p>
<p>Danke im Voraus &amp; Gruß,<br />
Moony</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509634</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509634</guid><dc:creator><![CDATA[Moony]]></dc:creator><pubDate>Thu, 15 May 2008 12:23:28 GMT</pubDate></item><item><title><![CDATA[Reply to Applikationsverzeichnis und Dateiname zusammenfügen on Thu, 15 May 2008 12:58:51 GMT]]></title><description><![CDATA[<p>Habe die Lösung gefunden:</p>
<pre><code class="language-cpp">void GetMyOrientation( void )
{
  FILE *Ptr;
  char FName [255];

  char szAppPath[_MAX_PATH];
  char drive[_MAX_DRIVE];
  char dir[_MAX_DIR];
  char fname[_MAX_FNAME];
  char ext[_MAX_EXT];

  GetModuleFileName(NULL,szAppPath,sizeof(szAppPath));

  _splitpath(szAppPath, drive, dir, fname, ext);

  lstrcat(FName,drive);
  lstrcat(FName,dir);
  lstrcat(FName,&quot;datacard.tmp_&quot;);

  Ptr = fopen(FName, &quot;r&quot;);
  gets(Line);
  fclose(Ptr);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1509700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509700</guid><dc:creator><![CDATA[Moony]]></dc:creator><pubDate>Thu, 15 May 2008 12:58:51 GMT</pubDate></item></channel></rss>