Le probleme est qu'il y a que la derniere ligne qui s'affiche, je pige pas pourquoi !
Voila le code :
//
#include <vcl.h>
#pragma hdrstop
#include "comparatif.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tcomp *comp;
//---------------------------------------------------------------------------
__fastcall Tcomp::Tcomp(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tcomp::Button1Click(TObject *Sender)
{ ShortString score[100];// score est un tableau ou sont stockés les infos à afficher.
AnsiString a;
int x,y,b,nbt[1];//NBT est un tableau qui indique le nombre d'enregistrement, aucun probleme de ce coté.
HANDLE hfile9;
DWORD zut9;
hfile9=CreateFile("score.dat",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
ReadFile(hfile9,&score[0],sizeof(score),&zut9,NULL);
CloseHandle(hfile9);
HANDLE hfile8;
DWORD zut8;
hfile8=CreateFile("nbt.dat",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
ReadFile(hfile8,&nbt[0],sizeof(nbt),&zut8,NULL);
CloseHandle(hfile8);
a=FloatToStr(nbt[0]);
Canvas->TextOut(10,10,a);
StringGrid->Cells[0][0]=" CPU-X86";
StringGrid->Cells[1][0]="Marque CPU";
StringGrid->Cells[2][0]="Type CPU";
StringGrid->Cells[3][0]="Modèle CPU W2K";
StringGrid->Cells[4][0]=" MHz";
StringGrid->Cells[5][0]="NB";
StringGrid->Cells[6][0]="Nom de l'OS";
StringGrid->Cells[7][0]="Version de l'OS";
StringGrid->Cells[8][0]="Score";
StringGrid->Cells[0][1]=" Test 1:";
StringGrid->Cells[0][2]=" Test 2:";
StringGrid->Cells[0][3]=" Test 3:";
StringGrid->Cells[0][4]=" Test 4:";
StringGrid->Cells[0][5]=" Test 5:";
StringGrid->Cells[0][6]=" Test 6:";
StringGrid->Cells[0][7]=" Test 7:";
StringGrid->Cells[0][8]=" Test 8:";
StringGrid->Cells[0][9]=" Test 9:";
StringGrid->Cells[0][10]=" Test 10:";
StringGrid->Cells[0][11]=" Test 11:";
StringGrid->Cells[0][12]=" Test 12:";
b=-1;
for (y=1 ; y<(nbt[0]+1) ; y++)
{for (x=1 ; x<9 ; x++)
{b=b+1;
StringGrid->Cells[x][y]=score[b];
};
};
}
MERCI