// -------------------------------------------------------------------------- // ========================================================================== // File: TDXFileLoadResource.CPP // Authors: BCB_Code_Generator v2.00, // Darren Dwyer (source code, documentation, demos, website), // Hugh Edwards (documentation, icons) // Description: This file contains the code for the TDXFileLoadResource // Component // // "TDx9_XFile_Library v1.00" // (c) 2005 BCB-Tools.com Pty. Ltd., Sydney, Australia. // All Rights Reserved. // // Refer to the 'Licence.Txt' file for licencing & copyright information. // ========================================================================== // -------------------------------------------------------------------------- // #includes ... // -------------------------------------------------------------------------- #include #pragma hdrstop // -------------------------------------------------------------------------- #include "TDXFileLoadResource.H" // -------------------------------------------------------------------------- #pragma link "TDx_Library_Defns" #pragma link "TDx_Library_Functions" #pragma link "TDx9_XFile_Library_Defns" #pragma link "TDx9_XFile_Library_Functions" // -------------------------------------------------------------------------- // Object Registration... // -------------------------------------------------------------------------- #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ #pragma package(smart_init) #endif // -------------------------------------------------------------------------- static inline void ValidCtrCheck(TDXFileLoadResource*) { new TDXFileLoadResource(NULL); } // -------------------------------------------------------------------------- namespace Tdxfileloadresource { #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ void __fastcall PACKAGE Register() #else void __fastcall Register() #endif { TComponentClass classes[1] = {__classid(TDXFileLoadResource)}; RegisterComponents("", classes, 0); } } // -------------------------------------------------------------------------- // Constructor: TDXFileLoadResource::TDXFileLoadResource() // Description: The default constructor for the TDXFileLoadResource object. // -------------------------------------------------------------------------- __fastcall TDXFileLoadResource::TDXFileLoadResource(TComponent* Owner) : TComponent(Owner) { Clear(); } // -------------------------------------------------------------------------- // Destructor: TDXFileLoadResource::~TDXFileLoadResource() // Description: The destructor for the TDXFileLoadResource object. // -------------------------------------------------------------------------- __fastcall TDXFileLoadResource::~TDXFileLoadResource() { } // -------------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TDXFileLoadResource method or // fget/fset. eg. or DDERR_SURFACELOST or TDX_ERROR // -------------------------------------------------------------------------- HRESULT __fastcall TDXFileLoadResource::FGetErrorValue() { return fErrorValue; } // -------------------------------------------------------------------------- void __fastcall TDXFileLoadResource::FSetErrorValue( HRESULT pErrorValue ) { fErrorValue = pErrorValue; } // -------------------------------------------------------------------------- // Property: Module // Description: ... // -------------------------------------------------------------------------- HMODULE __fastcall TDXFileLoadResource::FGetModule() { return fDXFILELOADRESOURCE.hModule; } // -------------------------------------------------------------------------- void __fastcall TDXFileLoadResource::FSetModule( HMODULE pModule ) { fDXFILELOADRESOURCE.hModule = pModule; } // -------------------------------------------------------------------------- // Property: Name // Description: ... // -------------------------------------------------------------------------- AnsiString __fastcall TDXFileLoadResource::FGetName() { if ((LPCTSTR)fName.c_str()!=fDXFILELOADRESOURCE.lpName) fName = fDXFILELOADRESOURCE.lpName; return fName; } // -------------------------------------------------------------------------- void __fastcall TDXFileLoadResource::FSetName( AnsiString pName ) { fName = pName; fDXFILELOADRESOURCE.lpName = (LPCTSTR) fName.c_str(); } // -------------------------------------------------------------------------- // Property: Size // Description: The Size property contains the size in bytes of the internal // _DXFILELOADRESOURCE structure. // -------------------------------------------------------------------------- dword __fastcall TDXFileLoadResource::FGetSize() { return fSize; } // -------------------------------------------------------------------------- void __fastcall TDXFileLoadResource::FSetSize( dword pSize ) { fSize = pSize; } // -------------------------------------------------------------------------- // Property: Type // Description: ... // -------------------------------------------------------------------------- AnsiString __fastcall TDXFileLoadResource::FGetType() { if ((LPCTSTR)fType.c_str()!=fDXFILELOADRESOURCE.lpType) fType = fDXFILELOADRESOURCE.lpType; return fType; } // -------------------------------------------------------------------------- void __fastcall TDXFileLoadResource::FSetType( AnsiString pType ) { fType = pType; fDXFILELOADRESOURCE.lpType = (LPCTSTR) fType.c_str(); } // -------------------------------------------------------------------------- // Method: Clear() // Description: The Clear() method can be used to clear the contents of the // TDXFileLoadResource's internal DXFILELOADRESOURCE structure. // Note: if you have manually linked a structure member to a // chunk of memory, make sure you release this memory before // calling Clear(). // -------------------------------------------------------------------------- void __fastcall TDXFileLoadResource::Clear() { fErrorValue = ; fSize = sizeof(_DXFILELOADRESOURCE); } // -------------------------------------------------------------------------- // Internal Structure Access // -------------------------------------------------------------------------- DXFILELOADRESOURCE* __fastcall TDXFileLoadResource::FGetInternal_DXFILELOADRESOURCE_Ptr() { return &fDXFILELOADRESOURCE; } // -------------------------------------------------------------------------- void __fastcall TDXFileLoadResource::FSetInternal_DXFILELOADRESOURCE( DXFILELOADRESOURCE* pDXFILELOADRESOURCE ) { if (pDXFILELOADRESOURCE==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TDXFileLoadResource::FSetInternal_DXFILELOADRESOURCE()", "TDX_ERROR", "The supplied DXFILELOADRESOURCE* was NULL" ); return; } CopyMemory( &fDXFILELOADRESOURCE, pDXFILELOADRESOURCE, sizeof(DXFILELOADRESOURCE) ); Internal_DXFILELOADRESOURCE_Update(); } // -------------------------------------------------------------------------- void __fastcall TDXFileLoadResource::Internal_DXFILELOADRESOURCE_Update() { } // --------------------------------------------------------------------------