Anonymous avatar Anonymous committed 6cc5122

I don't really know what all this was about, it might overlap with other codebases.

Comments (0)

Files changed (12)

Binary file added.

+/* ApMSgBox, include header for end users, to allow access to exported
+functions of ApMsgBox.OBJ. In case of errors make sure that these files
+are accessible: APMSGBOX.HPP  -  include header
+                APMSGBOX.OBJ  -  Code to run the messagebox & exported stuff
+                APMSGBOX.DFM  -  Form description file referenced from OBJ
+*/
+//---------------------------------------------------------------------------
+#ifndef __cplusplus
+	#error ApMsgBox is designed for C++
+#endif
+#ifdef APMsgBoxH
+	#pragma message ("You have include the header file APMsgBox.HPP already!")
+#endif
+#ifndef APMsgBoxH
+#define APMsgBoxH
+//---------------------------------------------------------------------------
+#include <vcl\Classes.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <vcl\Forms.hpp>
+#include <vcl\ExtCtrls.hpp>
+#include <vcl\Buttons.hpp>
+#pragma link "c:\\program files\\borland\\cbuilder\\projects\\shared\\obj\\apmsgbox\\apmsgbox.obj" // LINK: For our code
+//#pragma link "c:\\program files\\borland\\cbuilder\\projects\\shared\\obj\\apmsgbox\\apmsgbox.dfm" // Object links form
+//---------------------------------------------------------------------------
+class TApMsgBox1 : public TForm
+{
+public:		// User declarations
+	__fastcall TApMsgBox1(TComponent* Owner);
+    int Execute(char* DialogText, char* DialogCaption, short BitmapPicture, short CmdAvail);
+    int GetObjectVersion();
+};
+//---------------------------------------------------------------------------
+extern TApMsgBox1 *ApMsgBox1;
+//---------------------------------------------------------------------------
+// Defines for 'ApMsgBox1's bitmaps
+#define APMSGBOX1_EXCLAIM 0
+#define APMSGBOX1_HAND 1
+#define APMSGBOX1_INFO 2
+#define APMSGBOX1_QUESTION 3
+// Defines for 'ApMsgBox1's command buttons
+#define APMSGBOX1_OK 0
+#define APMSGBOX1_YESNO 1
+#define APMSGBOX1_YESNOCANCEL 2
+#define APMSGBOX1_OKCANCEL 3
+#define APMSGBOX1_RETRYCANCEL 4
+#endif

apmsgbox_external_manager.cpp

+#include "c:\program files\borland\cbuilder\projects\shared\obj\apmsgbox\apmsgbox.hpp"
+#include "ApMsgBox external manager.h"
+//------------------------------------------------------------------------------
+__fastcall TApMsgBoxMan1::TApMsgBoxMan1()
+{
+	ApMsgBox/*member*/ = new TApMsgBox1(NULL);
+}
+//------------------------------------------------------------------------------
+__fastcall TApMsgBoxMan1::~TApMsgBoxMan1()
+{
+	delete ApMsgBox;
+}
+//------------------------------------------------------------------------------
+int TApMsgBoxMan1::Execute(char* trans1, char* trans2, short trans3, short trans4)
+{
+	return ApMsgBox->Execute(trans1, trans2, trans3, trans4);
+}
+//------------------------------------------------------------------------------

apmsgbox_external_manager.h

+#ifndef APMSGBOXEXTMANH
+#define APMSGBOXEXTMANH
+//------------------------------------------------------------------------------
+/* External management class for TApMsgBox,
+this copy is for the .DLL not for the users */
+//------------------------------------------------------------------------------
+class _export TApMsgBoxMan1
+{
+public:
+	__fastcall TApMsgBoxMan1(void); // constructor
+    __fastcall ~TApMsgBoxMan1(void); // destructor
+    int Execute(char*, char*, short, short);
+private:
+		TApMsgBox1* ApMsgBox;
+};
+//------------------------------------------------------------------------------
+#endif // APMSGBOXEXTMANH
+//---------------------------------------------------------------------------
+#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.
+//---------------------------------------------------------------------------
+USERES("CExert.res");
+USEFORM("ConvFormUnit.cpp", ConvForm);
+USEUNIT("ApMsgBox external manager.cpp");
+//---------------------------------------------------------------------------
+#include "ApMsgBox.hpp"
+#include "ConvFormUnit.h"
+#include "ApMsgBox external manager.h"
+//---------------------------------------------------------------------------
+// exports
+extern "C" char* __declspec(dllexport) DynamicPCharFromDelphiString(String*);
+extern "C" String* __declspec(dllexport) StaticDelphiStringFromPChar(const char*);
+//---------------------------------------------------------------------------
+int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
+{
+	return 1;
+}
+//---------------------------------------------------------------------------
+String* StaticDelphiStringFromPChar(const char* Pchr)
+{
+	TConvForm* ConvForm = new TConvForm(NULL);
+    if (!ConvForm)
+    {
+    	/* failed to create conversion form */
+    	char* ErrMsg = new char[128];
+        if (!ErrMsg)
+        {
+        	/* not even enough RAM to concat error */
+            Application->MessageBox("Not enough heap to even concat. err string!", "EMERGENCY EXIT", MB_ICONSTOP + MB_OK);
+            abort();
+        }
+        strcpy(ErrMsg, "Not enough heap to create window handle during conversion of PCHAR at ");
+        strcat(ErrMsg, (const char*)Pchr);
+        strcat(ErrMsg, "to DelphiString.");
+        Application->MessageBox(ErrMsg, "CExcert.DLL::StaticDelphiStringFromPChar error", MB_ICONSTOP + MB_OK);
+        delete ErrMsg;
+    	return NULL;
+    }
+    /* CONVERSION FORM CREATED */
+    ConvForm->ConvEdit->Text = (String)Pchr; // load the editbox with the char array
+	String ConvString = ConvForm->ConvEdit->Text; // Make a copy of the text to address
+    String* ConvPString = &ConvString;
+	return ConvPString;
+}
+//---------------------------------------------------------------------------
+char* DynamicPCharFromDelphiString(String* PDelphiStr)
+{
+	TConvForm* ConvForm = new TConvForm(NULL);
+    if (!ConvForm)
+    {
+    	/* failed to create conversion form */
+    	char* ErrMsg = new char[128];
+        if (!ErrMsg)
+        {
+        	/* not even enough RAM to concat error */
+            Application->MessageBox("Not enough heap to even concat. err string!", "EMERGENCY EXIT", MB_ICONSTOP + MB_OK);
+            abort();
+        }
+        strcpy(ErrMsg, "Not enough heap to create window handle during conversion of DelphiString at ");
+        strcat(ErrMsg, (const char*)PDelphiStr);
+        strcat(ErrMsg, "to C's PCHAR type.");
+        Application->MessageBox(ErrMsg, "CExcert.DLL::DynamicPCharFromDelphiString error", MB_ICONSTOP + MB_OK);
+        delete ErrMsg;
+    	return NULL;
+    }
+    /* CONVERSION FORM CREATED */
+    ConvForm->ConvEdit->Text = *PDelphiStr; // load the editbox with the string
+    int BuffSize = ConvForm->ConvEdit->GetTextLen(); // remember the buffer size needed to hold this String
+	char* ConvBuffer = new char[++BuffSize]; // Allocate the buffer, incrementing to allow for the NULL terminator byte
+	ConvForm->ConvEdit->GetTextBuf(ConvBuffer, BuffSize); // Get the buffer from the string (ha ha)
+    // return the buffer without deleting it, heap free for buffer is caller's responsibillity
+	return ConvBuffer;
+}
+//------------------------------------------------------------------------------
+# ---------------------------------------------------------------------------
+VERSION = BCB.01
+# ---------------------------------------------------------------------------
+!ifndef BCB
+BCB = $(MAKEDIR)\..
+!endif
+# ---------------------------------------------------------------------------
+PROJECT = CExert.dll
+OBJFILES = CExert.obj ConvFormUnit.obj "ApMsgBox external manager.obj"
+RESFILES = CExert.res
+RESDEPEN = $(RESFILES) ConvFormUnit.dfm
+LIBFILES = 
+DEFFILE = 
+# ---------------------------------------------------------------------------
+CFLAG1 = -WD -O2 -w -k- -r -vi -c -a4 -b- -w-par -w-inl -Vx -Ve -x
+CFLAG2 = -I$(BCB)\projects;$(BCB)\include;$(BCB)\include\vcl \
+   -H=$(BCB)\lib\vcl.csm 
+PFLAGS = -U$(BCB)\projects;$(BCB)\lib\obj;$(BCB)\lib \
+   -I$(BCB)\projects;$(BCB)\include;$(BCB)\include\vcl \
+   -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -$L- \
+   -$D- -JPHNV -M     
+RFLAGS = -i$(BCB)\projects;$(BCB)\include;$(BCB)\include\vcl 
+LFLAGS = -L$(BCB)\projects;$(BCB)\lib\obj;$(BCB)\lib -aa -Tpd -x -V4.0 
+IFLAGS = 
+LINKER = tlink32
+# ---------------------------------------------------------------------------
+ALLOBJ = c0d32.obj $(OBJFILES)
+ALLRES = $(RESFILES)
+ALLLIB = $(LIBFILES) vcl.lib import32.lib cp32mt.lib 
+# ---------------------------------------------------------------------------
+.autodepend
+
+$(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) -o$* $* 
+
+.c.obj:
+    $(BCB)\BIN\bcc32 $(CFLAG1) $(CFLAG2) -o$* $**
+
+.rc.res:
+    $(BCB)\BIN\brcc32 $(RFLAGS) $<
+#-----------------------------------------------------------------------------

Binary file added.

+#ifndef CEXERTIH
+#define CEXERTIH
+//------------------------------------------------------------------------------
+/* CExert import header for users of the the .DLL */
+//------------------------------------------------------------------------------
+class _import TApMsgBoxMan1;
+extern "C" char* __declspec(dllimport) DynamicPCharFromDelphiString(String*);
+//------------------------------------------------------------------------------
+#endif // CEXERTIH

Binary file added.

+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "ConvFormUnit.h"
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TConvForm *ConvForm;
+//---------------------------------------------------------------------------
+__fastcall TConvForm::TConvForm(TComponent* Owner)
+	: TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------

Binary file added.

+//---------------------------------------------------------------------------
+#ifndef ConvFormUnitH
+#define ConvFormUnitH
+//---------------------------------------------------------------------------
+#include <vcl\Classes.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <vcl\Forms.hpp>
+//---------------------------------------------------------------------------
+class TConvForm : public TForm
+{
+__published:	// IDE-managed Components
+	TEdit *ConvEdit;
+private:	// User declarations
+public:		// User declarations
+	__fastcall TConvForm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern TConvForm *ConvForm;
+//---------------------------------------------------------------------------
+#endif
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.