First commit 05/03/2000

This commit is contained in:
2021-09-12 22:06:12 +02:00
commit dc9568579a
9 changed files with 358 additions and 0 deletions

160
Emp.bpr Normal file
View File

@ -0,0 +1,160 @@
# ---------------------------------------------------------------------------
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
# ---------------------------------------------------------------------------
# IDE SECTION
# ---------------------------------------------------------------------------
# The following section of the project makefile is managed by the BCB IDE.
# It is recommended to use the IDE to change any of the values in this
# section.
# ---------------------------------------------------------------------------
VERSION = BCB.03
# ---------------------------------------------------------------------------
PROJECT = Emp.exe
OBJFILES = Emp.obj Empaquetador.obj
RESFILES = Emp.res
DEFFILE =
RESDEPEN = $(RESFILES) Empaquetador.dfm
LIBFILES =
LIBRARIES = VCLDB35.lib VCL35.lib
SPARELIBS = VCL35.lib VCLDB35.lib
PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi QRPT35.bpi TEEUI35.bpi \
VCLSMP35.bpi TEEDB35.bpi TEE35.bpi NMFAST35.bpi INETDB35.bpi INET35.bpi \
JD_soft.bpi CDopping.bpi bcbsmp35.bpi dclocx35.bpi ibsmp35.bpi QSElFrm.bpi
# ---------------------------------------------------------------------------
PATHCPP = .;
PATHASM = .;
PATHPAS = .;
PATHRC = .;
DEBUGLIBPATH = $(BCB)\lib\debug
RELEASELIBPATH = $(BCB)\lib\release
# ---------------------------------------------------------------------------
CFLAG1 = -Od -Hc -w -Ve -r- -k -y -v -vi- -c -b- -w-par -w-inl -Vx -tW
CFLAG2 = -I$(BCB)\include;$(BCB)\include\vcl -D_RTLDLL -H=$(BCB)\lib\vcl35.csm
CFLAG3 = -Tkh30000
PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \
-I$(BCB)\include;$(BCB)\include\vcl -D_RTLDLL -$Y -$W -$O- -v -JPHN -M
RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl -D_RTLDLL
AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /d_RTLDLL /mx /w2 /zd
LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) -aa -Tpe -x -Gn -v
IFLAGS =
# ---------------------------------------------------------------------------
ALLOBJ = c0w32.obj sysinit.obj $(OBJFILES)
ALLRES = $(RESFILES)
ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib
# ---------------------------------------------------------------------------
!ifdef IDEOPTIONS
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=3082
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
HostApplication=
!endif
# ---------------------------------------------------------------------------
# MAKE SECTION
# ---------------------------------------------------------------------------
# This section of the project file is not used by the BCB IDE. It is for
# the benefit of building from the command-line using the MAKE utility.
# ---------------------------------------------------------------------------
.autodepend
# ---------------------------------------------------------------------------
!if !$d(BCC32)
BCC32 = bcc32
!endif
!if !$d(DCC32)
DCC32 = dcc32
!endif
!if !$d(TASM32)
TASM32 = tasm32
!endif
!if !$d(LINKER)
LINKER = ilink32
!endif
!if !$d(BRCC32)
BRCC32 = brcc32
!endif
# ---------------------------------------------------------------------------
!if $d(PATHCPP)
.PATH.CPP = $(PATHCPP)
.PATH.C = $(PATHCPP)
!endif
!if $d(PATHPAS)
.PATH.PAS = $(PATHPAS)
!endif
!if $d(PATHASM)
.PATH.ASM = $(PATHASM)
!endif
!if $d(PATHRC)
.PATH.RC = $(PATHRC)
!endif
# ---------------------------------------------------------------------------
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
$(BCB)\BIN\$(LINKER) @&&!
$(LFLAGS) +
$(ALLOBJ), +
$(PROJECT),, +
$(ALLLIB), +
$(DEFFILE), +
$(ALLRES)
!
# ---------------------------------------------------------------------------
.pas.hpp:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.pas.obj:
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
.cpp.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.c.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
.asm.obj:
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
.rc.res:
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
# ---------------------------------------------------------------------------

21
Emp.cpp Normal file
View File

@ -0,0 +1,21 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
USERES("Emp.res");
USEFORM("Empaquetador.cpp", Form1);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
return 0;
}
//---------------------------------------------------------------------------

BIN
Emp.exe Normal file

Binary file not shown.

BIN
Emp.res Normal file

Binary file not shown.

131
Empaquetador.cpp Normal file
View File

@ -0,0 +1,131 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <stdio.h>
#include <io.h>
#include "Empaquetador.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Edit1DblClick(TObject *Sender)
{
OpenDialog1->DefaultExt = "MTX";
OpenDialog1->FileName = "*.mtx";
if (OpenDialog1->Execute())
{
Edit1->Text = OpenDialog1->FileName;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Edit4DblClick(TObject *Sender)
{
OpenDialog1->DefaultExt = "ZIP";
OpenDialog1->FileName = "*.zip";
if (OpenDialog1->Execute())
{
Edit4->Text = OpenDialog1->FileName;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Memo1DblClick(TObject *Sender)
{
OpenDialog1->DefaultExt = "TXT";
OpenDialog1->FileName = "*.txt";
if (OpenDialog1->Execute())
{
Memo1->Lines->LoadFromFile( OpenDialog1->FileName );
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Memo2DblClick(TObject *Sender)
{
OpenDialog1->DefaultExt = "TXT";
OpenDialog1->FileName = "*.txt";
if (OpenDialog1->Execute())
{
Memo2->Lines->LoadFromFile( OpenDialog1->FileName );
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Anexa( FILE *out, AnsiString FICH )
{
FILE *mtx; int charc;
if ( (mtx = fopen( (FICH.c_str()), "rb" ) ) != NULL )
{
while( (charc = fgetc(mtx) ) != EOF )
fputc( charc, out );
fclose( mtx );
}
}
//---------------------------------------------------------------------------
int FILE_LENGHT( char *X )
{
int handle, Y;
handle = open( X, 0 );
Y = filelength(handle);
close(handle);
return Y;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
SaveDialog1->DefaultExt = "EXE";
SaveDialog1->FileName = "*.exe";
if (SaveDialog1->Execute())
{
long longitud;
FILE *out;
#define infor "TMP1-informacion.txt"
#define licencia "TMP2-licencia.txt"
if ( (out = fopen( (SaveDialog1->FileName).c_str(), "wb" ) ) != NULL )
{
// Copiamos MATRIX
Anexa( out, Edit1->Text );
// Informacion de interes...
char longt;
longt = (char)Edit2->Text.Length();
fputc( longt, out );
longt = (char)Edit3->Text.Length() + 4;
fputc( longt, out );
fputc( 0x00, out );
fputc( 0x00, out );
int tinfo, tlic;
Memo1->Lines->SaveToFile( infor );
tinfo = FILE_LENGHT( infor );
Memo2->Lines->SaveToFile( licencia );
tlic = FILE_LENGHT( licencia );
fwrite( &tinfo, sizeof( int ), 1, out );
fwrite( &tlic, sizeof( int ), 1, out );
fputc( 0x00, out );
fputc( 0x00, out );
fputc( 0x00, out );
fputc( 0x00, out );
fputc( 0x80, out );
fputc( 0x92, out );
fputc( 0x00, out );
fputc( 0x00, out );
fputs( (Edit2->Text).c_str(), out );
fputs( (Edit3->Text).c_str(), out );
fputs( ".INF", out );
Anexa( out, infor );
Anexa( out, licencia );
Anexa( out, Edit4->Text );
fclose( out );
}
}
}
//---------------------------------------------------------------------------

BIN
Empaquetador.dfm Normal file

Binary file not shown.

37
Empaquetador.h Normal file
View File

@ -0,0 +1,37 @@
//---------------------------------------------------------------------------
#ifndef EmpaquetadorH
#define EmpaquetadorH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Dialogs.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TMemo *Memo1;
TMemo *Memo2;
TEdit *Edit1;
TEdit *Edit2;
TEdit *Edit3;
TEdit *Edit4;
TButton *Button1;
TOpenDialog *OpenDialog1;
TSaveDialog *SaveDialog1;
void __fastcall Edit1DblClick(TObject *Sender);
void __fastcall Edit4DblClick(TObject *Sender);
void __fastcall Memo1DblClick(TObject *Sender);
void __fastcall Memo2DblClick(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
void __fastcall Anexa( FILE *out, AnsiString FICH );
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

BIN
Matrix2.mtx Normal file

Binary file not shown.

9
README.md Normal file
View File

@ -0,0 +1,9 @@
#Empaquetador
*05/03/2000*
ToDo: wwtcf?
![screenshot](/Empaquetador.png "Screenshot")