home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 April
/
Chip_1997-04_cd.bin
/
prezent
/
cb
/
data.z
/
BCB.EXE
/
RCDATA
/
MODULES
< prev
next >
Wrap
Text File
|
1997-01-16
|
12KB
|
370 lines
//$$---- plain unit HDR ---- $Revision: 1.43 $
//---------------------------------------------------------------------------
#ifndef %sH
#define %sH
//---------------------------------------------------------------------------
#endif
|//$$---- plain Unit CPP ----
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "%s.h"
//---------------------------------------------------------------------------
|//$$---- Form HDR ----
//---------------------------------------------------------------------------
#ifndef %sH
#define %sH
//---------------------------------------------------------------------------
#include <vcl\Classes.hpp>
#include <vcl\Controls.hpp>
#include <vcl\StdCtrls.hpp>
#include <vcl\Forms.hpp>
//---------------------------------------------------------------------------
class T%s : public T%s
{
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
virtual __fastcall T%s(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern T%s *%s;
//---------------------------------------------------------------------------
#endif
|//$$---- Form CPP ----
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "%s.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
T%s *%s;
//---------------------------------------------------------------------------
__fastcall T%s::T%s(TComponent* Owner)
: T%s(Owner)
{
}
//---------------------------------------------------------------------------
|//$$---- Component HDR ----
//---------------------------------------------------------------------------
#ifndef %sH
#define %sH
//---------------------------------------------------------------------------
#include <vcl\sysutils.hpp>
#include <vcl\controls.hpp>
#include <vcl\classes.hpp>
#include <vcl\forms.hpp>
//---------------------------------------------------------------------------
class %s : public %s
{
private:
protected:
public:
virtual __fastcall %s(TComponent* Owner);
__published:
};
//---------------------------------------------------------------------------
#endif
|//$$---- Component CPP ----
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "%s.h"
//---------------------------------------------------------------------------
static inline %s *ValidCtrCheck()
{
return new %s(NULL);
}
//---------------------------------------------------------------------------
__fastcall %s::%s(TComponent* Owner)
: %s(Owner)
{
}
//---------------------------------------------------------------------------
namespace %s
{
void __fastcall Register()
{
TComponentClass classes[1] = {__classid(%s)};
RegisterComponents("%s", classes, 0);
}
}
//---------------------------------------------------------------------------
|//$$---- Automation HDR ----
//---------------------------------------------------------------------------
#ifndef %sH
#define %sH
//---------------------------------------------------------------------------
#include <vcl\oleauto.hpp>
#include <vcl\Classes.hpp>
//---------------------------------------------------------------------------
class %s : public TAutoObject
{
private:
public:
virtual __fastcall %2:s();
__automated:
};
//---------------------------------------------------------------------------
#endif
|//$$---- Automation CPP ----
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "%0:s.h"
//---------------------------------------------------------------------------
__fastcall %1:s::%1:s()
: TAutoObject()
{
}
//---------------------------------------------------------------------------
void __fastcall Register%1:s()
{
TAutoClassInfo AutoClassInfo;
AutoClassInfo.AutoClass = __classid(%1:s);
AutoClassInfo.ProgID = "%3:s";
AutoClassInfo.ClassID = "%4:s";
AutoClassInfo.Description = "%5:s";
AutoClassInfo.Instancing = %6:s;
Automation->RegisterClass(AutoClassInfo);
}
//---------------------------------------------------------------------------
#pragma startup Register%1:s
//---------------------------------------------------------------------------
|//$$---- Thread HDR ----
//---------------------------------------------------------------------------
#ifndef %sH
#define %sH
//---------------------------------------------------------------------------
#include <vcl\Classes.hpp>
//---------------------------------------------------------------------------
class %s : public TThread
{
private:
protected:
void __fastcall Execute();
public:
virtual __fastcall %2:s(bool CreateSuspended);
};
//---------------------------------------------------------------------------
#endif
|//$$---- Thread CPP ----
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "%s.h"
//---------------------------------------------------------------------------
// Important: Methods and properties of objects in VCL can only be
// used in a method called using Synchronize, for example:
//
// Synchronize(UpdateCaption);
//
// where UpdateCaption could look like:
//
// void __fastcall %1:s::UpdateCaption()
// {
// Form1->Caption = "Updated in a thread";
// }
//---------------------------------------------------------------------------
__fastcall %1:s::%1:s(bool CreateSuspended)
: TThread(CreateSuspended)
{
}
//---------------------------------------------------------------------------
void __fastcall %1:s::Execute()
{
//---- Place thread code here ----
}
//---------------------------------------------------------------------------
|//$$---- EXE CPP ----
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
return 0;
}
//---------------------------------------------------------------------------
|//$$---- DLL CPP ----
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
// Important note about DLL memory management:
//
// If your DLL exports any functions that pass String objects (or structs/
// classes containing nested Strings) as parameter or function results,
// you will need to add the library BCBMM.LIB to both the DLL project and any
// EXE projects that use the DLL. This will change the DLL and its calling
// EXE's to use the BCBMM.DLL as their memory manager. In these cases,
// the file BCBMM.DLL should be deployed along with your DLL.
//
// To avoid using BCBMM.DLL, pass string information using "char *" or
// ShortString parameters.
//---------------------------------------------------------------------------
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
return 1;
}
//---------------------------------------------------------------------------
|//$$---- Console App CPP ----
//---------------------------------------------------------------------------
#include <vcl\condefs.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#pragma hdrstop
//---------------------------------------------------------------------------
int main(int argc, char **argv)
{
return 0;
}
//---------------------------------------------------------------------------
|//$$---- Comp Lib #1 ----
//---------------------------------------------------------------------------
// Component Palette
// Copyright (c) 1996, 1996 by Borland International, All Rights Reserved
//
// Module generated by C++Builder to rebuild the Component
// Palette Library (CMPLIB32.CCL).
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// In order to be totally Delphi compatible, the Component palette must be
// built with a namespaced version of the VCL library. Using namespace allows
// us to have multiple functions all called 'Register'.
//---------------------------------------------------------------------------
#if !defined(BCB_NAMESPACES)
#define BCB_NAMESPACES
#endif
//---------------------------------------------------------------------------
// Include DSTRING.H - Defines AnsiString support class
//---------------------------------------------------------------------------
#include <vcl\dstring.h>
//---------------------------------------------------------------------------
// The following are expanded inline to avoid pulling in the headers
// and lengthen the compilation time when rebuilding the palette.
//---------------------------------------------------------------------------
typedef void* HINSTANCE;
#if !defined(WINAPI)
#define WINAPI __stdcall
#endif
#if !defined(DLL_PROCESS_ATTACH)
#define DLL_PROCESS_ATTACH 1
#endif
#if !defined(DLL_THREAD_ATTACH)
#define DLL_THREAD_ATTACH 2
#endif
#if !defined(DLL_THREAD_DETACH)
#define DLL_THREAD_DETACH 3
#endif
#if !defined(DLL_PROCESS_DETACH)
#define DLL_PROCESS_DETACH 0
#endif
namespace Libmain {
typedef void __fastcall (*TRegisterProc)(void);
extern void __fastcall RegisterModule(const System::AnsiString Name, TRegisterProc RegisterProc);
}
using namespace Libmain;
namespace System {
extern void __cdecl ProcessAttachTLS(void);
extern void __cdecl ProcessDetachTLS(void);
extern void __cdecl ThreadAttachTLS(void);
extern void __cdecl ThreadDetachTLS(void);
}
using namespace System;
//---------------------------------------------------------------------------
// Prototype for each component's 'Register routine. Followed
// by instruction to have linker pull in the OBJ. module which
// implements the Register routine.
//
// Each component is expect to provide a routine with the
// following signature:
//
// extern void __fastcall Register(void);
//
// This routine must be in a namespace which matches the
// name of the component itself. Therefore, the routine is
// actually prototyped as:
//
// namespace Componentname {
// extern void __fastcall Register(void);
// };
//
// NOTE: The namespace must be in all lowercase characters
// except for the first one. i.e. Namespacename.
//---------------------------------------------------------------------------
|//$$---- Comp Lib #2 ----
|//$$---- Comp Lib #3 ----
|//$$---- Comp Lib #4 ----
//---------------------------------------------------------------------------
// Routine which registers the various modules implementing components
//---------------------------------------------------------------------------
bool
InitCmpLib()
{
|//$$---- Comp Lib #5 ----
return true;
}
//---------------------------------------------------------------------------
// Library's entry point
//---------------------------------------------------------------------------
extern "C"
int WINAPI
DllEntryPoint(HINSTANCE /*hInstance*/, unsigned long reason, void*)
{
switch (reason) {
case DLL_PROCESS_ATTACH:
ProcessAttachTLS();
InitCmpLib();
break;
case DLL_PROCESS_DETACH:
ProcessDetachTLS();
break;
case DLL_THREAD_ATTACH:
ThreadAttachTLS();
break;
case DLL_THREAD_DETACH:
ThreadDetachTLS();
break;
}
return 1;
}
|//$$---- end of code ----