🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11728

Re: how does fwrite i fread works ?

#11728
From: ScOe
Date: Wed, 21 Jan 2004 12:53
42 lines
2093 bytes
"ScOe" <cbinders@hotmail.com> wrote in message
news:400a7f9e@newsgroups.borland.com...

Reading function:

TTBarButton *TempcBZButtons = new TTBarButton ();
sGroupInfo sGroup;
int nMaxButton = 0;
do {
    retval = fread(&sGroup, sizeof (sGroup)+1, 1, stream);
    for (int i=0; i< sGroup.iNumberOfItems ; i++) {
        retval = fread(&TempcBZButtons, sizeof(TempcBZButtons)+1, 1,
stream);
        if (retval == 0)
            break;
        TListItem *pItem = frmSettings->ListView1->Items->Add ();
        pItem->Caption = TempcBZButtons->AppPath;
        frmTBar->CBZ_Toolbar->CurrentBar->CopyToNewButton (TempcBZButtons);
        frmTBar->NewSPBut(); // screen painting procedure
        nMaxButton++;
        }
    } while (retval != 0);
fclose(stream); /* close file */

what should i use for class dumping to file ?
I need to save all the elements from class.

class TTBarButton : public TCurrentBar
{
private:
    int FButtonID;
    Graphics::TBitmap *FIconGlyph;
    TIcon *FIcon;
    String FHint;
    String FAppPath;
    int FIconIndex;
    ...    //functions definitions
public:
    TPoint GridPosition;
    ...    //functions definitions
};
Technical Details
Message-ID: <400e7685@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <400a7f9e@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,feb805d47c7e2f2b
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-01-21 05:09:41 PST
From: "ScOe" <cbinders@hotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <400a7f9e@newsgroups.borland.com>
Subject: Re: how does fwrite i fread works ?
Date: Wed, 21 Jan 2004 13:53:48 +0100
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 193.198.138.208
Message-ID: <400e7685@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1074689669 193.198.138.208 (21 Jan 2004 04:54:29 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail