![]() |
öffnen von binary-Dateien (C++) mit Delphi
Liste der Anhänge anzeigen (Anzahl: 1)
Hallo,
ich habe vor ein bereits bestehendes System mit Hilfe von Delphi 2005 zu erweitern. Das Problem ist, dass hierfür mit C++ abgespeicherte binary-Dateien von Delphi geöffnet werden müssen. Der Source Code in C zum Öffnen dieser Datei ist folgender: // martin3.cpp : Defines the entry point for the console application. #include "stdafx.h" #include <cstdlib> #include <iostream> #include <fstream> #ifndef TtypesH #define TtypesH using namespace std; int s; int main(int argc, char* argv) { // values are in Filename with ending ".001" typedef struct MeasureHeader { unsigned int MeasureCount; //unsigned char SystemCount; char LackNr[5]; char Karosse[3]; unsigned char Ort; char FileNamePart[19]; } t_MeasureHeader; // values are in Filename with ending ".001" typedef struct TabMeasure { unsigned int ID; double StartTime; double EndTime; double Result; // dE wert unsigned char Output; // 1=IO 2=NIO 3=NoC unsigned char SysCount; __int64 StartPos_TabSystem[6]; // max. 6 Systeme d.h. 6 Kameras } t_TabMeasure; #endif //----Daten ausgeben--------------------------------------------------------------------------- ifstream file("001", ios::binary); {if(!file) {cerr <<"Fehler beim Oeffnen der Datei \n"<< argv[1] <<endl; system("PAUSE"); return 2;}} // Datei geladen t_TabMeasure col; for (s = 0; s < 10; s++) { // Die ersten 10 Datensätze ausgeben file.read( ( char* )&col, sizeof(t_TabMeasure)); cout << col.ID << " : " << col.StartTime << " : " << col.EndTime; printf("\n\n"); } system("PAUSE"); return 0; } Ist es möglich die Datei in Delphi zu öffnen, wenn ja, wie? Die zu öffnede Datei habe ich gepackt und angehängt. |
Re: öffnen von binary-Dateien (C++) mit Delphi
Delphi-Quellcode:
TabMeasure = Record
ID: Cardinal; StartTime: Double; {oder TDateTime?} EndTime: Double; Result: Double; Output: Byte; // 1=IO 2=NIO 3=NoC Byte: SysCount; StartPos_TabSystem: Array[1..6] of Int64; // max. 6 Systeme d.h. 6 Kameras end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:32 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz