<?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[Probelme mit Printer() und  weiterem Programm ablauf]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein kleines Problem mit Printer() und dem weiteren Programmablauf.</p>
<p>ich drucke mit Printer() den inhalt eines TMemo feldes aus den ich vorher mittels einer struktus aus eine datei eingelesen habe</p>
<pre><code class="language-cpp">struct Struktur
{
        char Nummer[6];
        char ob_1[100];
        char ob_2[100];
        char ob_3[100];
        char ob_4[100];
};

void __fastcall TForm1::Open(...)
{
struct Struktur Dat;

FILE *Read_Datei;
Read_Datei = fopen(&quot;datei.dat&quot;,&quot;r&quot;);

while(fread(&amp;Dat,sizeof(Struktur),1, Read_Daten))
{
...
}
}
</code></pre>
<p>wenn ich nach dem drucken die datei wieder einlesen will bleibt der debugger<br />
an der stelle &quot;while(fread(&amp;Dat,sizeof(Struktur),1, Read_Daten))&quot; stehen<br />
und es kommt eine fehlermeldung &quot;Access violation at adress ... in module 'CC3260MT.DLL'. Read of adress ... .&quot;</p>
<p>ich benutze BCB6</p>
<p>Wer weis Rat?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/108430/probelme-mit-printer-und-weiterem-programm-ablauf</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 21:01:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/108430.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Apr 2005 10:14:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probelme mit Printer() und  weiterem Programm ablauf on Fri, 29 Apr 2005 10:14:17 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein kleines Problem mit Printer() und dem weiteren Programmablauf.</p>
<p>ich drucke mit Printer() den inhalt eines TMemo feldes aus den ich vorher mittels einer struktus aus eine datei eingelesen habe</p>
<pre><code class="language-cpp">struct Struktur
{
        char Nummer[6];
        char ob_1[100];
        char ob_2[100];
        char ob_3[100];
        char ob_4[100];
};

void __fastcall TForm1::Open(...)
{
struct Struktur Dat;

FILE *Read_Datei;
Read_Datei = fopen(&quot;datei.dat&quot;,&quot;r&quot;);

while(fread(&amp;Dat,sizeof(Struktur),1, Read_Daten))
{
...
}
}
</code></pre>
<p>wenn ich nach dem drucken die datei wieder einlesen will bleibt der debugger<br />
an der stelle &quot;while(fread(&amp;Dat,sizeof(Struktur),1, Read_Daten))&quot; stehen<br />
und es kommt eine fehlermeldung &quot;Access violation at adress ... in module 'CC3260MT.DLL'. Read of adress ... .&quot;</p>
<p>ich benutze BCB6</p>
<p>Wer weis Rat?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/778264</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/778264</guid><dc:creator><![CDATA[_manuel_]]></dc:creator><pubDate>Fri, 29 Apr 2005 10:14:17 GMT</pubDate></item><item><title><![CDATA[Reply to Probelme mit Printer() und  weiterem Programm ablauf on Fri, 29 Apr 2005 10:26:09 GMT]]></title><description><![CDATA[<p>Hmm.. hast du die Datei mittels fclose wieder ordnungsgemäß geschlossen? Ansonsten wäre vllt. etwas mehr Quelltext hilfreich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/778274</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/778274</guid><dc:creator><![CDATA[Dasd]]></dc:creator><pubDate>Fri, 29 Apr 2005 10:26:09 GMT</pubDate></item><item><title><![CDATA[Reply to Probelme mit Printer() und  weiterem Programm ablauf on Fri, 29 Apr 2005 10:48:31 GMT]]></title><description><![CDATA[<p>ja die datei ist auch mit fclose geschlossen worden<br />
habe auch den reserviereten speicher für die struktur mit delete und free() freigegeben. aber bringt nix.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/778286</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/778286</guid><dc:creator><![CDATA[_manuel_]]></dc:creator><pubDate>Fri, 29 Apr 2005 10:48:31 GMT</pubDate></item><item><title><![CDATA[Reply to Probelme mit Printer() und  weiterem Programm ablauf on Fri, 29 Apr 2005 10:52:18 GMT]]></title><description><![CDATA[<p>Hmm... In welchem Modus wurde die Datei denn geschrieben? Vllt. musst du binär lesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/778289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/778289</guid><dc:creator><![CDATA[Dasd]]></dc:creator><pubDate>Fri, 29 Apr 2005 10:52:18 GMT</pubDate></item><item><title><![CDATA[Reply to Probelme mit Printer() und  weiterem Programm ablauf on Fri, 29 Apr 2005 12:30:59 GMT]]></title><description><![CDATA[<p>Die datei hat die selbestruktur und ich habe sie mit fwrite() geschreiben.<br />
wenn ich nicht drucke kann ich so oft ich will die datei neu lesen, das hatte ich vergessen zu sagen <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>
]]></description><link>https://www.c-plusplus.net/forum/post/778374</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/778374</guid><dc:creator><![CDATA[_manuel_]]></dc:creator><pubDate>Fri, 29 Apr 2005 12:30:59 GMT</pubDate></item><item><title><![CDATA[Reply to Probelme mit Printer() und  weiterem Programm ablauf on Fri, 29 Apr 2005 12:37:08 GMT]]></title><description><![CDATA[<p>Dann wirst du uns wohl doch zeigen müssen, wie du das Memo befüllst und wie du druckst, also alle relevanten Codeabschnitte. Idealerweise erstellst du dafür ein Minimalprojekt, dass du dann komplett posten kannst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/778380</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/778380</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Fri, 29 Apr 2005 12:37:08 GMT</pubDate></item><item><title><![CDATA[Reply to Probelme mit Printer() und  weiterem Programm ablauf on Fri, 29 Apr 2005 13:00:00 GMT]]></title><description><![CDATA[<p>ok hier der Code</p>
<pre><code class="language-cpp">void __fastcall Tprint::Print()
{
int DPI = 96;
int randx = 0;
int randy = 0;
int left = 0;
int page = 1;
bool links = false;
String Seite;

Printer()-&gt;BeginDoc();

DPI = GetDeviceCaps(Printer()-&gt;Canvas-&gt;Handle, LOGPIXELSX);
randx = GetDeviceCaps(Printer()-&gt;Canvas-&gt;Handle, PHYSICALOFFSETX);
randy = GetDeviceCaps(Printer()-&gt;Canvas-&gt;Handle, PHYSICALOFFSETY);
Vorlage(); //fucktion zum zeichnen einer vorlage
int j = 0;
for(int i = 0;i&lt;= Form1-&gt;Memo1-&gt;Lines-&gt;Count;i++)
{
        Printer()-&gt;Canvas-&gt;TextOut(cmToPixel(4,DPI,randx)+left,cmToPixel(6+(j*0.5),DPI,randy),Form1-&gt;Memo1-&gt;Lines-&gt;Strings[i]);
        j++;

        if((j == 42)&amp;&amp;(links == true))
        {
        Printer()-&gt;NewPage();
        left = 0;
        links = false;
        j = 0;

        Vorlage(); 

        }
        if(j == 42)
        {
                j = 0;
                left = cmToPixel(7.5,DPI,randx);
                links = true;
        }

}       

Printer()-&gt;EndDoc();

void __fastcall TForm1::Open(String AObjekt, String AMonat, String AJahr)
{
struct Objektdaten objekt;
struct Daten SUDaten;
Memo1-&gt;Clear();
Label1-&gt;Caption = AObjekt;
FILE *Read_Objekt;
Read_Objekt = fopen(&quot;objekte.azo&quot;,&quot;r&quot;);

while(fread(&amp;objekt,sizeof(Objektdaten),1, Read_Objekt))
{
        String OBJ = LeftStr(objekt.Objektnr,6);
        if(OBJ == LeftStr(AObjekt,6))
        {
                Label2-&gt;Caption = objekt.ob_1;
                Label3-&gt;Caption = objekt.ob_2;
                Label4-&gt;Caption = objekt.ob_3;
                Label5-&gt;Caption = objekt.ob_4;
                break;
        }
        else
        {
                Label2-&gt;Caption = &quot;Keine Objektdaten vorhaden&quot;;
                Label3-&gt;Caption = &quot;&quot;;
                Label4-&gt;Caption = &quot;&quot;;
                Label5-&gt;Caption = &quot;&quot;;
        }
}
fclose(Read_Objekt);

FILE *Read_Daten;
char pfad[1000];
strcpy(pfad, GetCurrentDir().c_str());
strcat(pfad, &quot;\\Daten\\&quot;);
strcat(pfad, AJahr.c_str());
strcat(pfad, &quot;\\&quot;);
strcat(pfad, AMonat.c_str());
strcat(pfad, &quot;-&quot;);
strcat(pfad, AJahr.c_str());
strcat(pfad, &quot;.azs&quot;);

Read_Daten = fopen(pfad,&quot;r&quot;);

while(fread(&amp;SUDaten,sizeof(SUDaten),1, Read_Daten))
{
        if(AObjekt == LeftStr(SUDaten.Objektnr,8))
        {
                Memo1-&gt;Lines-&gt;Add(LeftStr(SUDaten.datum,10) + &quot;  &quot; + LeftStr(SUDaten.zeit,5) + &quot;  &quot; + SUDaten.meldung);
        }
}

fclose(Read_Daten);

}
//---------------------------------------------------------------------------
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/778407</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/778407</guid><dc:creator><![CDATA[_manuel_]]></dc:creator><pubDate>Fri, 29 Apr 2005 13:00:00 GMT</pubDate></item></channel></rss>