10#if !defined(OWL_MODULE_H)
14#if defined(BI_HAS_PRAGMA_ONCE)
25#include <Unknwnbase.h>
54 auto IsString() const ->
bool {
return (Representation >> 16) != 0;}
55 auto IsAtom() const ->
bool {
return !IsString();}
56 auto GetString() const ->
tstring;
103 bool IsLoaded()
const;
113 tstring GetModuleFileName()
const;
129 std::string LoadHtml(
TResId)
const;
232 uint32 GetSignature()
const;
233 uint32 GetStrucVersion()
const;
234 uint32 GetFileVersionMS()
const;
235 uint32 GetFileVersionLS()
const;
236 uint32 GetProductVersionMS()
const;
237 uint32 GetProductVersionLS()
const;
239 uint32 GetFileFlagsMask()
const;
240 uint32 GetFileFlags()
const;
241 bool IsDebug()
const;
242 bool InfoInferred()
const;
243 bool IsPatched()
const;
244 bool IsPreRelease()
const;
245 bool IsPrivateBuild()
const;
246 bool IsSpecialBuild()
const;
248 TFileType GetFileType()
const;
249 uint32 GetFileSubType()
const;
250 FILETIME GetFileDate()
const;
277 uint GetLanguage()
const;
278 tstring GetLanguageName()
const;
337 const tstring& SysMessage()
const;
374#if defined(BI_COMP_BORLANDC)
449 static T*& DllPtrRef();
469 T*&
dll = DllPtrRef();
471 if (
dll ==
nullptr) {
489 T*&
dll = DllPtrRef();
501 return DllPtrRef() !=
nullptr;
554 (
reinterpret_cast<TProc>(Proc))();
562 TModuleProc0(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
566 return (
reinterpret_cast<TProc>(Proc))();
574 TModuleProcV1(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
578 (
reinterpret_cast<TProc>(Proc))(
p1);
583template <
class R,
class P1>
586 TModuleProc1(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
590 return (
reinterpret_cast<TProc>(Proc))(
p1);
595template <
class P1,
class P2>
598 TModuleProcV2(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
607template <
class R,
class P1,
class P2>
610 TModuleProc2(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
614 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2);
619template <
class P1,
class P2,
class P3>
622 TModuleProcV3(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
631template <
class R,
class P1,
class P2,
class P3>
634 TModuleProc3(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
638 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3);
643template <
class P1,
class P2,
class P3,
class P4>
646 TModuleProcV4(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
655template <
class R,
class P1,
class P2,
class P3,
class P4>
658 TModuleProc4(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
667template <
class P1,
class P2,
class P3,
class P4,
class P5>
670 TModuleProcV5(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
679template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5>
682 TModuleProc5(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
691template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6>
694 TModuleProcV6(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
703template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6>
706 TModuleProc6(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
715template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
class P7>
718 TModuleProcV7(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
728template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
732 TModuleProc7(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
742template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
746 TModuleProcV8(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
756template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
760 TModuleProc8(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
770template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
771 class P7,
class P8,
class P9>
774 TModuleProcV9(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
784template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
785 class P7,
class P8,
class P9>
788 TModuleProc9(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
798template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
802 TModuleProcV10(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
813template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
817 TModuleProc10(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
828template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
832 TModuleProcV11(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
838 (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11);
843template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
847 TModuleProc11(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
853 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11);
858template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
862 TModuleProcV12(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
868 (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12);
873template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
877 TModuleProc12(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
883 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12);
888template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
892 TModuleProcV13(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
899 (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13);
904template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
908 TModuleProc13(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
915 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13);
919template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
class P7,
923 TModuleProcV14(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
929 (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13,
p14);
933template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
938 TModuleProc14(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
944 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13,
p14);
948template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
class P7,
953 TModuleProcV15(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
960 (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13,
p14,
p15);
964template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
969 TModuleProc15(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
976 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
981template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
class P7,
986 TModuleProcV16(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
993 (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13,
p14,
998template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
1003 TModuleProc16(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
1010 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
1015template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
class P7,
1020 TModuleProcV17(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
1027 (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13,
p14,
1032template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
1037 TModuleProc17(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
1044 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
1049template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
class P7,
1054 TModuleProcV18(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
1061 (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13,
p14,
1066template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
1071 TModuleProc18(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
1078 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
1083template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
class P7,
1088 TModuleProcV19(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
1096 (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13,
p14,
1101template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
1106 TModuleProc19(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
1114 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
1119template <
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
class P7,
1125 TModuleProcV20(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
1133 (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13,
p14,
1138template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6,
1144 TModuleProc20(
const TModule& module, TNarrowResId
id) : TModuleProc(module, id) {}
1152 return (
reinterpret_cast<TProc>(Proc))(
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
1226 return Name.c_str();
1284 return ::GetProcAddress(Handle,
id.GetPointerRepresentation());
1311 return ::FindResource(Handle,
id,
type);
1338 return ::FindResourceEx(Handle,
type,
id,
langId);
1355 return ::LoadResource(Handle,
hRsrc);
1372 return ::SizeofResource(Handle,
hRsrc);
1385 return ::CopyIcon(hIcon);
#define PRECONDITION(condition)
TDllLoader<> provides an easy way to load one instance of a DLL on demand.
TDocTemplate is an abstract base class that contains document template functionality.
Simple encapsulation of the SetErrorMode call.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TModuleProc is a base class that does inital binding of a function name or ordinal to the correspondi...
FARPROC Proc
Derived template classes perform type-safe parameter passing on call.
TModuleVersionInfo provides access to a TModule's VERSIONINFO resource.
delay loading OLEAUT32.DLL/OLE2DISP.DLL
delay loading Ole32.DLL/COMPOBJ.DLL
TResId encapsulates a Windows resource identifier.
Classes that inherit from TStreamableBase are known as streamable classes (their objects can be writt...
delay loading USER :), just for some memory/resource check programs
static BOOL GetClassInfo(HINSTANCE, LPCTSTR, LPWNDCLASS)
delay loading VERSION.DLL
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Derived from xmsg, TXBase is the base class for ObjectWindows and ObjectComponents exception-handling...
A nested class, TXInvalidModule describes an exception that results from an invalid module.
Exception class for TModuleVersionInfo. [VH 2005-04-03].
TXOwl is root class of the ObjectWindows exception hierarchy.
STDAPI_(TDocTemplate **) GetDocTemplateHead(uint32 version)
#define DECLARE_STREAMABLE_OWL(cls, ver)
#define DECLARE_STREAMABLE_INLINES(cls)
TWindowClassName(LPCTSTR s)
bool IsPreRelease() const
VS_FIXEDFILEINFO * FixedInfo
Fixed file info structure.
THandle GetHandle() const
Return the instance handle of the library module represented by the TModule obect.
auto GetClassInfo(TWindowClassName, WNDCLASS *wndclass) const -> bool
Retrieves information about the given window class.
TFileSubType
TFileSubType values are returned by GetFileSubType() if GetFileType.
HGLOBAL LoadResource(HRSRC hRsrc) const
Wrapper for the Windows API.
tstring GetModuleFileName() const
String-aware overload.
HRSRC FindResource(TResId id, TResId type) const
Wrapper for the Windows API to find a particular resource.
uint32 GetStrucVersion() const
auto IsString() const -> bool
uint32 GetFileOS() const
returns TFileOS values
VS_FIXEDFILEINFO & GetFixedInfo()
Return the version information about this module.
tstring GetLanguageName() const
Return the language name of this module.
uint32 GetFileFlags() const
HINSTANCE THandle
TModule encapsulates an HINSTANCE.
uint32 GetFileFlagsMask() const
TDllLoader()
Creates a dynamic copy of the DLL object (i.e.
uint GetLanguage() const
Return the language id of this module.
TFileType
TFileType is returned by GetFileType()
auto IsAtom() const -> bool
static bool IsAvailable()
Load the dll on demand, returning true if it was loaded OK.
bool InfoInferred() const
uint32 GetFileVersionMS() const
Get the major file version (first 32-bits).
auto GetPointerRepresentation() const -> LPCTSTR
uint32 GetFileVersionLS() const
Get the minor file version (last 32-bits).
uint32 SizeofResource(HRSRC hRsrc) const
Wrapper for the Windows API.
uint8 * Buff
new'd File version info buffer
TFileType GetFileType() const
HRSRC FindResourceEx(TResId id, TResId type, TLangId langId=LangNeutral) const
Wrapper for the Windows API to find a particular resource.
TFileOS
TFileOS values are returned by GetFileOS()
uint32 GetSignature() const
bool IsFileFlagSet(uint32 flag) const
Return true if the flag has been set in the version info.
~TErrorMode()
Destructor of TErrorMode object - restores the state of the error mode saved during construction of t...
LPCTSTR GetName() const
Returns the name of the module.
bool IsPrivateBuild() const
uint32 GetProductVersionMS() const
Get the major product version number (first 32-bits).
FARPROC GetProcAddress(TNarrowResId) const
Returns the entry-point address of the specified exported function if found, otherwise returns NULL.
uint32 GetProductVersionLS() const
Get the minor product version number (last 32-bits).
uint32 Lang
Default language translation.
const tstring & SysMessage() const
bool IsSpecialBuild() const
bool operator==(const TModule &m) const
Returns true if this instance is equal to the other instance; otherwise, returns false.
HICON CopyIcon(HICON hIcon) const
Wrapper for the Windows API.
TErrorMode(uint mode)
Constructs a TErrorMode object which invokes the 'SetErrorMode' API function to control how/whether W...
bool IsLoaded() const
Returns a nonzero value if the instance handle is loaded.
~TDllLoader()
Deletes the dll object when we go away to release the dll from memory.
@ KybdDriver
VFT2_DRV_KEYBOARD.
@ SysDriver
VFT2_DRV_SYSTEM.
@ VectorFont
VFT2_FONT_VECTOR.
@ InstallableDriver
VFT2_DRV_INSTALLABLE.
@ DisplayDriver
VFT2_DRV_DISPLAY.
@ RasterFont
VFT2_FONT_RASTER.
@ UnknownFont
VFT2_UNKNOWN.
@ LangDriver
VFT2_DRV_LANGUAGE.
@ MouseDriver
VFT2_DRV_MOUSE.
@ PtrDriver
VFT2_DRV_PRINTER.
@ SoundDriver
VFT2_DRV_SOUND.
@ NtwkDriver
VFT2_DRV_NETWORK.
TLocaleString - localized name support.
bool OWLInitUserDLL(HINSTANCE hInstance, LPCTSTR cmdLine)
Initialization routine that must be called from User DLL if DLL provides it's own entry point [i....
STDAPI_(owl::TDocTemplate **) GetDocTemplateHead(owl STDAPI_(owl::TModule **) GetModulePtr(owl in OwlMain)(int argc, TCHAR *argv[])
Main entry point for an Owl application.
Object Windows Library (OWLNext Core)
owl::uint16 TLangId
Holds a language ID, a predefined number that represents a base language and dialect.
const TLangId LangNeutral
BSTR SysAllocString(const char *str)
STDAPI __declspec(dllexport) DllRegisterCommand(LPCTSTR cmdLine)
Entry point for complete registration management via command line Don't let any exceptions blow back ...
General definitions used by all ObjectWindows programs.
ObjectWindows exception class & function definitions.
Various types of smart pointer templatized classes.
Classes for window system structure and type encapsulation.