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 >
Text File  |  1997-01-16  |  12KB  |  370 lines

  1. //$$---- plain unit HDR ----     $Revision:   1.43  $
  2. //---------------------------------------------------------------------------
  3. #ifndef %sH
  4. #define %sH
  5. //---------------------------------------------------------------------------
  6. #endif
  7. |//$$---- plain Unit CPP ----
  8. //---------------------------------------------------------------------------
  9. #include <vcl\vcl.h>
  10. #pragma hdrstop
  11.  
  12. #include "%s.h"
  13. //---------------------------------------------------------------------------
  14. |//$$---- Form HDR ----
  15. //---------------------------------------------------------------------------
  16. #ifndef %sH
  17. #define %sH
  18. //---------------------------------------------------------------------------
  19. #include <vcl\Classes.hpp>
  20. #include <vcl\Controls.hpp>
  21. #include <vcl\StdCtrls.hpp>
  22. #include <vcl\Forms.hpp>
  23. //---------------------------------------------------------------------------
  24. class T%s : public T%s
  25. {
  26. __published:    // IDE-managed Components
  27. private:    // User declarations
  28. public:        // User declarations
  29.     virtual __fastcall T%s(TComponent* Owner);
  30. };
  31. //---------------------------------------------------------------------------
  32. extern T%s *%s;
  33. //---------------------------------------------------------------------------
  34. #endif
  35. |//$$---- Form CPP ----
  36. //---------------------------------------------------------------------------
  37. #include <vcl\vcl.h>
  38. #pragma hdrstop
  39.  
  40. #include "%s.h"
  41. //---------------------------------------------------------------------------
  42. #pragma resource "*.dfm"
  43. T%s *%s;
  44. //---------------------------------------------------------------------------
  45. __fastcall T%s::T%s(TComponent* Owner)
  46.     : T%s(Owner)
  47. {
  48. }
  49. //---------------------------------------------------------------------------
  50. |//$$---- Component HDR ----
  51. //---------------------------------------------------------------------------
  52. #ifndef %sH
  53. #define %sH
  54. //---------------------------------------------------------------------------
  55. #include <vcl\sysutils.hpp>
  56. #include <vcl\controls.hpp>
  57. #include <vcl\classes.hpp>
  58. #include <vcl\forms.hpp>
  59. //---------------------------------------------------------------------------
  60. class %s : public %s
  61. {
  62. private:
  63. protected:
  64. public:
  65.     virtual __fastcall %s(TComponent* Owner);
  66. __published:
  67. };
  68. //---------------------------------------------------------------------------
  69. #endif
  70. |//$$---- Component CPP ----
  71. //---------------------------------------------------------------------------
  72. #include <vcl\vcl.h>
  73. #pragma hdrstop
  74.  
  75. #include "%s.h"
  76. //---------------------------------------------------------------------------
  77. static inline %s *ValidCtrCheck()
  78. {
  79.     return new %s(NULL);
  80. }
  81. //---------------------------------------------------------------------------
  82. __fastcall %s::%s(TComponent* Owner)
  83.     : %s(Owner)
  84. {
  85. }
  86. //---------------------------------------------------------------------------
  87. namespace %s
  88. {
  89.     void __fastcall Register()
  90.     {
  91.         TComponentClass classes[1] = {__classid(%s)};
  92.         RegisterComponents("%s", classes, 0);
  93.     }
  94. }
  95. //---------------------------------------------------------------------------
  96. |//$$---- Automation HDR ----
  97. //---------------------------------------------------------------------------
  98. #ifndef %sH
  99. #define %sH
  100. //---------------------------------------------------------------------------
  101. #include <vcl\oleauto.hpp>
  102. #include <vcl\Classes.hpp>
  103. //---------------------------------------------------------------------------
  104. class %s : public TAutoObject
  105. {
  106. private:
  107. public:
  108.     virtual __fastcall %2:s();
  109. __automated:
  110. };
  111. //---------------------------------------------------------------------------
  112. #endif
  113. |//$$---- Automation CPP ----
  114. //---------------------------------------------------------------------------
  115. #include <vcl\vcl.h>
  116. #pragma hdrstop
  117.  
  118. #include "%0:s.h"
  119. //---------------------------------------------------------------------------
  120. __fastcall %1:s::%1:s()
  121.     : TAutoObject()
  122. {
  123. }
  124. //---------------------------------------------------------------------------
  125. void __fastcall Register%1:s()
  126. {
  127.     TAutoClassInfo AutoClassInfo;
  128.  
  129.     AutoClassInfo.AutoClass = __classid(%1:s);
  130.     AutoClassInfo.ProgID = "%3:s";
  131.     AutoClassInfo.ClassID = "%4:s";
  132.     AutoClassInfo.Description = "%5:s";
  133.     AutoClassInfo.Instancing = %6:s;
  134.  
  135.     Automation->RegisterClass(AutoClassInfo);
  136. }
  137. //---------------------------------------------------------------------------
  138. #pragma startup Register%1:s
  139. //---------------------------------------------------------------------------
  140. |//$$---- Thread HDR ----
  141. //---------------------------------------------------------------------------
  142. #ifndef %sH
  143. #define %sH
  144. //---------------------------------------------------------------------------
  145. #include <vcl\Classes.hpp>
  146. //---------------------------------------------------------------------------
  147. class %s : public TThread
  148. {
  149. private:
  150. protected:
  151.     void __fastcall Execute();
  152. public:
  153.     virtual __fastcall %2:s(bool CreateSuspended);
  154. };
  155. //---------------------------------------------------------------------------
  156. #endif
  157. |//$$---- Thread CPP ----
  158. //---------------------------------------------------------------------------
  159. #include <vcl\vcl.h>
  160. #pragma hdrstop
  161.  
  162. #include "%s.h"
  163. //---------------------------------------------------------------------------
  164. //   Important: Methods and properties of objects in VCL can only be
  165. //   used in a method called using Synchronize, for example:
  166. //
  167. //      Synchronize(UpdateCaption);
  168. //
  169. //   where UpdateCaption could look like:
  170. //
  171. //      void __fastcall %1:s::UpdateCaption()
  172. //      {
  173. //        Form1->Caption = "Updated in a thread";
  174. //      }
  175. //---------------------------------------------------------------------------
  176. __fastcall %1:s::%1:s(bool CreateSuspended)
  177.     : TThread(CreateSuspended)
  178. {
  179. }
  180. //---------------------------------------------------------------------------
  181. void __fastcall %1:s::Execute()
  182. {
  183.     //---- Place thread code here ----
  184. }
  185. //---------------------------------------------------------------------------
  186. |//$$---- EXE CPP ----
  187. //---------------------------------------------------------------------------
  188. #include <vcl\vcl.h>
  189. #pragma hdrstop
  190. //---------------------------------------------------------------------------
  191. WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
  192. {
  193.     try
  194.     {
  195.         Application->Initialize();
  196.         Application->Run();
  197.     }
  198.     catch (Exception &exception)
  199.     {
  200.         Application->ShowException(&exception);
  201.     }
  202.     return 0;
  203. }
  204. //---------------------------------------------------------------------------
  205. |//$$---- DLL CPP ----
  206. //---------------------------------------------------------------------------
  207. #include <vcl\vcl.h>
  208. #pragma hdrstop
  209. //---------------------------------------------------------------------------
  210. //   Important note about DLL memory management:
  211. //
  212. //   If your DLL exports any functions that pass String objects (or structs/
  213. //   classes containing nested Strings) as parameter or function results,
  214. //   you will need to add the library BCBMM.LIB to both the DLL project and any
  215. //   EXE projects that use the DLL.  This will change the DLL and its calling
  216. //   EXE's to use the BCBMM.DLL as their memory manager.  In these cases,
  217. //   the file BCBMM.DLL should be deployed along with your DLL.
  218. //
  219. //   To avoid using BCBMM.DLL, pass string information using "char *" or
  220. //   ShortString parameters.
  221. //---------------------------------------------------------------------------
  222. int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
  223. {
  224.     return 1;
  225. }
  226. //---------------------------------------------------------------------------
  227. |//$$---- Console App CPP ----
  228. //---------------------------------------------------------------------------
  229. #include <vcl\condefs.h>
  230. #include <stdio.h>
  231. #include <stdlib.h>
  232. #include <string.h>
  233.  
  234. #pragma hdrstop
  235. //---------------------------------------------------------------------------
  236. int main(int argc, char **argv)
  237. {
  238.     return 0;
  239. }
  240. //---------------------------------------------------------------------------
  241. |//$$---- Comp Lib #1 ----
  242. //---------------------------------------------------------------------------
  243. // Component Palette
  244. // Copyright (c) 1996, 1996 by Borland International, All Rights Reserved
  245. //
  246. // Module generated by C++Builder to rebuild the Component
  247. // Palette Library (CMPLIB32.CCL).
  248. //---------------------------------------------------------------------------
  249.  
  250.  
  251. //---------------------------------------------------------------------------
  252. // In order to be totally Delphi compatible, the Component palette must be
  253. // built with a namespaced version of the VCL library. Using namespace allows
  254. // us to have multiple functions all called 'Register'.
  255. //---------------------------------------------------------------------------
  256. #if !defined(BCB_NAMESPACES)
  257. #define BCB_NAMESPACES
  258. #endif
  259.  
  260.  
  261. //---------------------------------------------------------------------------
  262. // Include DSTRING.H - Defines AnsiString support class
  263. //---------------------------------------------------------------------------
  264. #include <vcl\dstring.h>
  265.  
  266.  
  267. //---------------------------------------------------------------------------
  268. // The following are expanded inline to avoid pulling in the headers
  269. // and lengthen the compilation time when rebuilding the palette.
  270. //---------------------------------------------------------------------------
  271. typedef void* HINSTANCE;
  272.  
  273. #if !defined(WINAPI)
  274. #define WINAPI __stdcall
  275. #endif
  276. #if !defined(DLL_PROCESS_ATTACH)
  277. #define DLL_PROCESS_ATTACH 1
  278. #endif
  279. #if !defined(DLL_THREAD_ATTACH)
  280. #define DLL_THREAD_ATTACH  2
  281. #endif
  282. #if !defined(DLL_THREAD_DETACH)
  283. #define DLL_THREAD_DETACH  3
  284. #endif
  285. #if !defined(DLL_PROCESS_DETACH)
  286. #define DLL_PROCESS_DETACH 0
  287. #endif
  288.  
  289. namespace Libmain {
  290. typedef void __fastcall (*TRegisterProc)(void);
  291. extern  void __fastcall RegisterModule(const System::AnsiString Name, TRegisterProc RegisterProc);
  292. }
  293. using namespace Libmain;
  294.  
  295. namespace System {
  296. extern void __cdecl ProcessAttachTLS(void);
  297. extern void __cdecl ProcessDetachTLS(void);
  298. extern void __cdecl ThreadAttachTLS(void);
  299. extern void __cdecl ThreadDetachTLS(void);
  300. }
  301. using namespace System;
  302.  
  303.  
  304. //---------------------------------------------------------------------------
  305. // Prototype for each component's 'Register routine. Followed
  306. // by instruction to have linker pull in the OBJ. module which
  307. // implements the Register routine.
  308. //
  309. //  Each component is expect to provide a routine with the
  310. //  following signature:
  311. //
  312. //       extern void __fastcall Register(void);
  313. //
  314. //  This routine must be in a namespace which matches the
  315. //  name of the component itself. Therefore, the routine is
  316. //  actually prototyped as:
  317. //
  318. //       namespace Componentname {
  319. //           extern void __fastcall Register(void);
  320. //       };
  321. //
  322. //  NOTE: The namespace must be in all lowercase characters
  323. //        except for the first one. i.e. Namespacename.
  324. //---------------------------------------------------------------------------
  325. |//$$---- Comp Lib #2 ----
  326.  
  327. |//$$---- Comp Lib #3 ----
  328.  
  329. |//$$---- Comp Lib #4 ----
  330. //---------------------------------------------------------------------------
  331. // Routine which registers the various modules implementing components
  332. //---------------------------------------------------------------------------
  333. bool
  334. InitCmpLib()
  335. {
  336. |//$$---- Comp Lib #5 ----
  337.     return true;
  338. }
  339.  
  340. //---------------------------------------------------------------------------
  341. // Library's entry point
  342. //---------------------------------------------------------------------------
  343. extern "C"
  344. int WINAPI
  345. DllEntryPoint(HINSTANCE /*hInstance*/, unsigned long reason, void*)
  346. {
  347.     switch (reason) {
  348.         case DLL_PROCESS_ATTACH:
  349.             ProcessAttachTLS();
  350.             InitCmpLib();
  351.             break;
  352.  
  353.         case DLL_PROCESS_DETACH:
  354.             ProcessDetachTLS();
  355.             break;
  356.  
  357.         case DLL_THREAD_ATTACH:
  358.             ThreadAttachTLS();
  359.             break;
  360.  
  361.         case DLL_THREAD_DETACH:
  362.             ThreadDetachTLS();
  363.             break;
  364.     }
  365.     return 1;
  366. }
  367.  
  368. |//$$---- end of code ----
  369. 
  370.