- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
(extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
BT game source (never mixed into CODE/). Round 1-3 state:
* 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
(BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
since 1996.
* BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
its binary-recorded line 400 exactly.
* BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
(Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
TeamScore=12 flagged [T4]).
* MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
(VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
the period compiler is the drift detector).
* Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
(per-TU verification sweep under authentic OPT.MAK flags).
* README: corrected roadmap - MECH.HPP is the capstone grown with the mech
TU reconstructions; BTREG.CPP green = the header-family milestone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
158 lines
3.5 KiB
C++
158 lines
3.5 KiB
C++
//----------------------------------------------------------------------------
|
|
// ObjectWindows - (C) Copyright 1991, 1993 by Borland International
|
|
//----------------------------------------------------------------------------
|
|
#include <owl\owlpch.h>
|
|
#include <owl\applicat.h>
|
|
#include <owl\framewin.h>
|
|
#include <owl\dc.h>
|
|
#include <cstring.h>
|
|
#include "dllhello.h"
|
|
#include "calldll.h"
|
|
|
|
static TModule ResourceDll("resource.dll"); // DLL to be loaded.
|
|
|
|
class TTestWindow : public TWindow {
|
|
public:
|
|
TTestWindow() : TWindow(0, 0, ::Module) {} // associate with this module
|
|
|
|
void SetupWindow();
|
|
void CleanupWindow();
|
|
|
|
void CmCreate(); // Call into a DLL to create a window.
|
|
void CmRString(); // Load a String resource from a DLL.
|
|
void CmRCursor(); // Load a Cursor resource from a DLL.
|
|
void CmRIcon(); // Load a Icon resource from a DLL.
|
|
void CmRBitmap(); // Load a Bitmap resource from a DLL.
|
|
|
|
void Paint(TDC& dc, BOOL erase, TRect& rect);
|
|
|
|
private:
|
|
|
|
HICON SampleIcon; // Handle to Icon.
|
|
HBITMAP SampleBitmap; // Handle to Bitmap.
|
|
|
|
DECLARE_RESPONSE_TABLE(TTestWindow);
|
|
};
|
|
|
|
DEFINE_RESPONSE_TABLE1(TTestWindow, TWindow)
|
|
EV_COMMAND(CM_CREATE, CmCreate),
|
|
EV_COMMAND(CM_RSTRING, CmRString),
|
|
EV_COMMAND(CM_RCURSOR, CmRCursor),
|
|
EV_COMMAND(CM_RICON, CmRIcon),
|
|
EV_COMMAND(CM_RBITMAP, CmRBitmap),
|
|
END_RESPONSE_TABLE;
|
|
|
|
void
|
|
TTestWindow::SetupWindow()
|
|
{
|
|
TWindow::SetupWindow();
|
|
SampleIcon = 0;
|
|
SampleBitmap = 0;
|
|
}
|
|
|
|
void
|
|
TTestWindow::CleanupWindow()
|
|
{
|
|
if (SampleIcon)
|
|
::DestroyIcon(SampleIcon); // Cleanup resources.
|
|
if (SampleBitmap)
|
|
::DeleteObject(SampleBitmap);
|
|
TWindow::CleanupWindow();
|
|
}
|
|
|
|
//
|
|
// Call into DLL to create window.
|
|
//
|
|
void
|
|
TTestWindow::CmCreate()
|
|
{
|
|
CreateDLLWindow(HWindow);
|
|
}
|
|
|
|
//
|
|
// Load a String from resource DLL. Display it in a message box.
|
|
//
|
|
void
|
|
TTestWindow::CmRString()
|
|
{
|
|
const RESLEN=30;
|
|
|
|
char far* str = new char[RESLEN];
|
|
|
|
ResourceDll.LoadString(ID_STRING, str, RESLEN);
|
|
MessageBox(str, "The String Is!", MB_OK);
|
|
delete[] str;
|
|
}
|
|
|
|
//
|
|
// Load and set Cursor for window.
|
|
//
|
|
void
|
|
TTestWindow::CmRCursor()
|
|
{
|
|
SetCursor(&ResourceDll, ID_CURSOR);
|
|
}
|
|
|
|
//
|
|
// Load and display cursor on window.
|
|
//
|
|
void
|
|
TTestWindow::CmRIcon()
|
|
{
|
|
char temp[5];
|
|
string resIdAsString;
|
|
|
|
itoa(ID_ICON, temp, 10);
|
|
resIdAsString = "#";
|
|
resIdAsString += temp;
|
|
SampleIcon = ResourceDll.LoadIcon(resIdAsString.c_str());
|
|
CHECK(SampleIcon);
|
|
Invalidate();
|
|
}
|
|
|
|
//
|
|
// Load and display Bitmap on window.
|
|
//
|
|
void
|
|
TTestWindow::CmRBitmap()
|
|
{
|
|
SampleBitmap = ResourceDll.LoadBitmap(ID_BITMAP);
|
|
CHECK(SampleBitmap);
|
|
Invalidate();
|
|
}
|
|
|
|
//
|
|
// Will display Icon and Bitmap resource if they have been loaded.
|
|
//
|
|
void
|
|
TTestWindow::Paint(TDC& dc, BOOL, TRect&)
|
|
{
|
|
if (SampleIcon)
|
|
dc.DrawIcon(5, 5, TIcon(SampleIcon));
|
|
if (SampleBitmap) {
|
|
TMemoryDC memDC;
|
|
memDC.SelectObject(TBitmap(SampleBitmap));
|
|
dc.BitBlt(50, 5, 64, 64, memDC, 0, 0 );
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
class TCallDllApp : public TApplication {
|
|
public:
|
|
void InitMainWindow();
|
|
};
|
|
|
|
void
|
|
TCallDllApp::InitMainWindow()
|
|
{
|
|
MainWindow = new TFrameWindow(0, "CallDll", new TTestWindow);
|
|
MainWindow->AssignMenu("COMMANDS");
|
|
}
|
|
|
|
int
|
|
OwlMain(int /*argc*/, char* /*argv*/ [])
|
|
{
|
|
return TCallDllApp().Run();
|
|
}
|