#ifndef TDPApplicationDescH #define TDPApplicationDescH // ========================================================================== // File: TDPApplicationDesc.H // Authors: BCB_Code_Generator v1.70, // Darren Dwyer (source code, documentation, demos, website), // Hugh Edwards (documentation, icons), // Brian Austin (some source code, documentation) // Description: This file defines the TDPApplicationDesc Component // // "TDx_Play_Library v1.70" // (c) 2003 BCB-Tools.com Pty. Ltd., Sydney, Australia. // All Rights Reserved. // // Refer to the 'Licence.Txt' file for licencing & copyright information. // ========================================================================== // -------------------------------------------------------------------------- #include "TDx_Library_Defns.H" #include "TDx_Library_Functions.H" // -------------------------------------------------------------------------- #include "TDx_Play_Library_Defns.H" #include "TDx_Play_Library_Functions.H" // -------------------------------------------------------------------------- // ========================================================================== // Class: TDPApplicationDesc // Description: The TDPApplicationDesc component wraps the DPAPPLICATIONDESC2 // structure which holds information required to register a // lobby aware application. // // Use this component in the // TDx_PlayLobby::RegisterApplication() method to provide the // registration values for the application. // ========================================================================== #if (__BORLANDC__ >= 0x0530) // BCB Version 3 + class PACKAGE TDPApplicationDesc : public TComponent { // -------------------------------------------------------------------------- #else // BCB Version 1 class TDPApplicationDesc : public TComponent { #endif // ========================================================================== __published: // ========================================================================== // ---------------------------------------------------------------------- // Property: AppLauncherNameA // Description: The AppLauncherNameA property references the name of the // launcher executable, stored as an ANSI string. // // Once started by the lobby, the launcher application is // responsible for launching the application described in // TDPApplicationDesc::ApplicationName. // The launcher application must reside in the same // directory as the application. // ---------------------------------------------------------------------- __property AnsiString AppLauncherNameA = { read=FGetAppLauncherNameA, write=FSetAppLauncherNameA, nodefault }; // ---------------------------------------------------------------------- // Property: ApplicationNameA // Description: The ApplicationNameA property references the applications // name, stored as an ANSI string. // // This is a non-localized property, use // TDPApplicationDesc::DescriptionA and // TDPApplicationDesc::Description for localization of the // application name. // ---------------------------------------------------------------------- __property AnsiString ApplicationNameA = { read=FGetApplicationNameA, write=FSetApplicationNameA, nodefault }; // ---------------------------------------------------------------------- // Property: CommandLineA // Description: The CommandLine property references command line // arguments passed to the executable when launching from a // lobby, stored as an ANSI string. // ---------------------------------------------------------------------- __property AnsiString CommandLineA = { read=FGetCommandLineA, write=FSetCommandLineA, nodefault }; // ---------------------------------------------------------------------- // Property: CurrentDirectoryA // Description: The CurrentDirectory property references the current // directory path, stored as an ANSI string. // // In most circumstances, this will be identical to // TDPApplicationDesc::Path or TDPApplicationDesc::PathA. // ---------------------------------------------------------------------- __property AnsiString CurrentDirectoryA = { read=FGetCurrentDirectoryA, write=FSetCurrentDirectoryA, nodefault }; // ---------------------------------------------------------------------- // Property: DescriptionA // Description: The DescriptionA property references the localized // description of the application. // // This value should be set to NULL if no localized ANSI // application description is required. // // TDx_PlayLobby::EnumLocalApplications() will return this // value if present, TDPApplicationDesc::ApplicationNameA // will be returned. // ---------------------------------------------------------------------- __property AnsiString DescriptionA = { read=FGetDescriptionA, write=FSetDescriptionA, nodefault }; // ---------------------------------------------------------------------- // Property: FilenameA // Description: The ApplicationName property references the file name of // the executable being launched, stored as an ANSI string. // // The main executable should be launched, even if this // requires bypassing a stub executable. // ---------------------------------------------------------------------- __property AnsiString FilenameA = { read=FGetFilenameA, write=FSetFilenameA, nodefault }; // ---------------------------------------------------------------------- // Property: PathA // Description: The Path property references the path to the executable // being launched, stored as an ANSI string. // ---------------------------------------------------------------------- __property AnsiString PathA = { read=FGetPathA, write=FSetPathA, nodefault }; // ---------------------------------------------------------------------- // Property: Size // Description: The Size property contains the size in bytes of the // internal DPAPPLICATIONDESC2 structure. // ---------------------------------------------------------------------- __property dword Size = { read=FGetSize, write=FSetSize, default=sizeof(DPAPPLICATIONDESC2) }; // ---------------------------------------------------------------------- // Event: OnError() // Description: The OnError event is called when an error occurs in the // TDPApplicationDesc component. // ---------------------------------------------------------------------- __property TDx_Error OnError = {read=FOnError, write=FOnError, nodefault}; // ========================================================================== public: // ========================================================================== // ---------------------------------------------------------------------- // Property: AppLauncherName // Description: The AppLauncherName property references the name of the // launcher executable, stored as a unicode string. // // Once started by the lobby, the launcher application is // responsible for launching the application described in // TDPApplicationDesc::ApplicationName. // The launcher application must reside in the same // directory as the application. // ---------------------------------------------------------------------- __property AnsiString AppLauncherName = { read=FGetAppLauncherName, write=FSetAppLauncherName, nodefault }; // ---------------------------------------------------------------------- // Property: Application // Description: The Application property identifies the application // launching the session. // // This identifier should be the same as // TDPSessionDesc::Application when hosting an application. // ---------------------------------------------------------------------- __property GUID Application = { read=FGetApplication, write=FSetApplication, nodefault }; // ---------------------------------------------------------------------- // Property: ApplicationName // Description: The ApplicationName property references the applications // name, stored as a unicode string. // // This is a non-localized property, use // TDPApplicationDesc::DescriptionA and // TDPApplicationDesc::Description for localization of the // application name. // ---------------------------------------------------------------------- __property AnsiString ApplicationName = { read=FGetApplicationName, write=FSetApplicationName, nodefault }; // ---------------------------------------------------------------------- // Property: CommandLine // Description: The CommandLine property references command line // arguments passed to the executable when launching from a // lobby, stored as a unicode string. // ---------------------------------------------------------------------- __property AnsiString CommandLine = { read=FGetCommandLine, write=FSetCommandLine, nodefault }; // ---------------------------------------------------------------------- // Property: CurrentDirectory // Description: The CurrentDirectory property references the current // directory path, stored as a unicode string. // // In most circumstances, this will be identical to // TDPApplicationDesc::Path or TDPApplicationDesc::PathA. // ---------------------------------------------------------------------- __property AnsiString CurrentDirectory = { read=FGetCurrentDirectory, write=FSetCurrentDirectory, nodefault }; // ---------------------------------------------------------------------- // Property: Description // Description: The Description property references the localized // description of the application, stored as a unicode // string. // // This value should be set to NULL if no localized unicode // application description is required. // // TDx_PlayLobby::EnumLocalApplications() will return this // value if present, otherwise // TDPApplicationDesc::DescriptionA will be converted to // unicode and returned. If neither exist, // TDPApplicationDesc::ApplicationName will be returned. // ---------------------------------------------------------------------- __property AnsiString Description = { read=FGetDescription, write=FSetDescription, nodefault }; // ---------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TDPApplicationDesc method or // fget/fset. eg. DP_OK or DDERR_SURFACELOST or TDX_ERROR // ---------------------------------------------------------------------- __property HRESULT ErrorValue = { read=FGetErrorValue, write=FSetErrorValue, default=DP_OK }; // ---------------------------------------------------------------------- // Property: Filename // Description: The ApplicationName property references the file name of // the executable being launched, stored as a unicode // string. // // The main executable should be launched, even if this // requires bypassing a stub executable. // ---------------------------------------------------------------------- __property AnsiString Filename = { read=FGetFilename, write=FSetFilename, nodefault }; // ---------------------------------------------------------------------- // Property: Path // Description: The Path property references the path to the executable // being launched, stored as a unicode string. // ---------------------------------------------------------------------- __property AnsiString Path = { read=FGetPath, write=FSetPath, nodefault }; // ---------------------------------------------------------------------- // Method: Clear() // Description: The Clear() method can be used to clear the contents of // the TDPApplicationDesc's internal DPAPPLICATIONDESC2 // structure. // Note: if you have manually linked a structure member to a // chunk of memory, make sure you release this memory before // calling Clear(). // ---------------------------------------------------------------------- virtual void __fastcall Clear(); // ---------------------------------------------------------------------- // Constructor() and Destructor() // ---------------------------------------------------------------------- __fastcall TDPApplicationDesc(TComponent* Owner); virtual __fastcall ~TDPApplicationDesc(); // ---------------------------------------------------------------------- // Internal Structure Access // ---------------------------------------------------------------------- __property DPAPPLICATIONDESC2* Internal_DPAPPLICATIONDESC2_Ptr = { read=FGetInternal_DPAPPLICATIONDESC2_Ptr, nodefault }; void __fastcall Internal_DPAPPLICATIONDESC2_Update(); // ========================================================================== protected: // ========================================================================== // ---------------------------------------------------------------------- // Property Access Methods // ---------------------------------------------------------------------- AnsiString __fastcall FGetAppLauncherName(); void __fastcall FSetAppLauncherName( AnsiString pAppLauncherName ); AnsiString __fastcall FGetAppLauncherNameA(); void __fastcall FSetAppLauncherNameA( AnsiString pAppLauncherNameA ); GUID __fastcall FGetApplication(); void __fastcall FSetApplication( GUID pApplication ); AnsiString __fastcall FGetApplicationName(); void __fastcall FSetApplicationName( AnsiString pApplicationName ); AnsiString __fastcall FGetApplicationNameA(); void __fastcall FSetApplicationNameA( AnsiString pApplicationNameA ); AnsiString __fastcall FGetCommandLine(); void __fastcall FSetCommandLine( AnsiString pCommandLine ); AnsiString __fastcall FGetCommandLineA(); void __fastcall FSetCommandLineA( AnsiString pCommandLineA ); AnsiString __fastcall FGetCurrentDirectory(); void __fastcall FSetCurrentDirectory( AnsiString pCurrentDirectory ); AnsiString __fastcall FGetCurrentDirectoryA(); void __fastcall FSetCurrentDirectoryA( AnsiString pCurrentDirectoryA ); AnsiString __fastcall FGetDescription(); void __fastcall FSetDescription( AnsiString pDescription ); AnsiString __fastcall FGetDescriptionA(); void __fastcall FSetDescriptionA( AnsiString pDescriptionA ); HRESULT __fastcall FGetErrorValue(); void __fastcall FSetErrorValue( HRESULT pErrorValue ); AnsiString __fastcall FGetFilename(); void __fastcall FSetFilename( AnsiString pFilename ); AnsiString __fastcall FGetFilenameA(); void __fastcall FSetFilenameA( AnsiString pFilenameA ); AnsiString __fastcall FGetPath(); void __fastcall FSetPath( AnsiString pPath ); AnsiString __fastcall FGetPathA(); void __fastcall FSetPathA( AnsiString pPathA ); dword __fastcall FGetSize(); void __fastcall FSetSize( dword pSize ); // ========================================================================== private: // ========================================================================== // ---------------------------------------------------------------------- // Internal Structure Access // ---------------------------------------------------------------------- DPAPPLICATIONDESC2* __fastcall FGetInternal_DPAPPLICATIONDESC2_Ptr(); void __fastcall FSetInternal_DPAPPLICATIONDESC2( DPAPPLICATIONDESC2* pDPAPPLICATIONDESC2 ); // ---------------------------------------------------------------------- // Property Variables // ---------------------------------------------------------------------- AnsiString fAppLauncherName; AnsiString fAppLauncherNameA; GUID fApplication; AnsiString fApplicationName; AnsiString fApplicationNameA; AnsiString fCommandLine; AnsiString fCommandLineA; AnsiString fCurrentDirectory; AnsiString fCurrentDirectoryA; AnsiString fDescription; AnsiString fDescriptionA; HRESULT fErrorValue; AnsiString fFilename; AnsiString fFilenameA; AnsiString fPath; AnsiString fPathA; // ---------------------------------------------------------------------- // Structure Variables // ---------------------------------------------------------------------- DPAPPLICATIONDESC2 fDPAPPLICATIONDESC2; // ---------------------------------------------------------------------- // Event Variables // ---------------------------------------------------------------------- TDx_Error FOnError; }; // -------------------------------------------------------------------------- #endif // --------------------------------------------------------------------------