#ifndef TDx9_PlayPeerH #define TDx9_PlayPeerH // ========================================================================== // File: TDx9_PlayPeer.H // Authors: BCB_Code_Generator v2.00, // Darren Dwyer (source code, documentation, demos, website), // Hugh Edwards (documentation, icons) // Description: This file defines the TDx9_PlayPeer Component // // "TDx9_Play_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. // ========================================================================== // -------------------------------------------------------------------------- #include "TDx_Library_Defns.H" #include "TDx_Library_Functions.H" // -------------------------------------------------------------------------- #include "TDx9_Play_Library_Defns.H" #include "TDx9_Play_Library_Functions.H" // -------------------------------------------------------------------------- // ========================================================================== // Class: TDx9_PlayPeer // Description: The TDx9_PlayPeer object is used to ... // ========================================================================== #if (__BORLANDC__ >= 0x0530) // BCB Version 3 + class PACKAGE TDx9_PlayPeer : public TComponent { // -------------------------------------------------------------------------- #else // BCB Version 1 class TDx9_PlayPeer : public TComponent { #endif // ========================================================================== __published: // ========================================================================== // ---------------------------------------------------------------------- // Event: OnCreate() // Description: The OnCreate() event is triggered by the // TDx9_PlayPeer::Create() method after it has successfully // created the internal LPIDIRECTPLAY8PEER used within the // TDx9_PlayPeer component. // // Note that since this event is only called upon successful // creation, this event is an ideal place for code that is // to be activated only once, immediately upon the // successful creation of the LPIDIRECTPLAY8PEER interface. // // For example, you could retrieve the TDx9_PlayPeer // component's capabilities, Create() dependant components, // allocate memory, etc. // // When used in conjunction with the // TDx9_PlayPeer::OnDestroy() event, you can fully automate // and insulate your code on a per-component basis. // ---------------------------------------------------------------------- __property TDx_Event OnCreate = {read=FOnCreate, write=FOnCreate, nodefault}; // ---------------------------------------------------------------------- // Event: OnDestroy() // Description: The OnDestroy() event is triggered by the // TDx9_PlayPeer::Destroy() method, just before the // TDx9_PlayPeer internal LPIDIRECTPLAY8PEER interface is // destroyed. // // Note: This event is an ideal place to place code that // reverses the results of the TDx9_PlayPeer::OnCreate() // event. For example, assume you have already setup the // TDx9_PlayPeer::OnCreate() event to retrieve the // component's capabilities, Create() a dependant component // and allocate some memory; // You can then fully automate and insulate your code on a // per-component basis by placing code in the // TDx9_PlayPeer::OnDestroy() event to deallocate memory, // Destroy() the dependant components and, when required, // destroy the capabilities component. // ---------------------------------------------------------------------- __property TDx_Event OnDestroy = {read=FOnDestroy, write=FOnDestroy, nodefault}; // ---------------------------------------------------------------------- // Event: OnError() // Description: The OnError event is called when an error occurs in the // TDx9_PlayPeer component. // ---------------------------------------------------------------------- __property TDx_Error OnError = {read=FOnError, write=FOnError, nodefault}; // ========================================================================== public: // ========================================================================== // ---------------------------------------------------------------------- // Property: Created // Description: The Created property is true if the internal // LPIDIRECTPLAY8PEER used in this component has been // successfully created, otherwise Created is false. // // To create the internal LPIDIRECTPLAY8PEER, call the // TDx9_PlayPeer::Create() method. // ---------------------------------------------------------------------- __property bool Created = { read=FGetCreated, write=FSetCreated, default=false }; // ---------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TDx9_PlayPeer method or // fget/fset. eg. or DDERR_SURFACELOST or TDX_ERROR // ---------------------------------------------------------------------- __property HRESULT ErrorValue = { read=FGetErrorValue, write=FSetErrorValue, nodefault }; // ---------------------------------------------------------------------- // Method: AddPlayerToGroup() // Description: The AddPlayerToGroup method is used to ... // Params: pDPNID - // The DPNID parameter ... // pconst - // The const parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: CancelAsyncOperation() // Description: The CancelAsyncOperation method is used to ... // Params: pDPNHANDLE - // The DPNHANDLE parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: Close() // Description: The Close method is used to ... // Params: pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: Connect() // Description: The Connect method is used to ... // Params: pDPN_APPLICATION_DESC - // The DPN_APPLICATION_DESC parameter ... // p*const - // The *const parameter ... // pDPN_SECURITY_DESC - // The DPN_SECURITY_DESC parameter ... // pDPN_SECURITY_CREDENTIALS - // The DPN_SECURITY_CREDENTIALS parameter ... // pvoid - // The void parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: Create() // Description: The Create() method is used to automatically create the // internal LPIDIRECTPLAY8PEER interface used in the // TDx9_PlayPeer component and must be called before any // methods of the TDx9_PlayPeer component will function. // ---------------------------------------------------------------------- virtual bool __fastcall Create(); // ---------------------------------------------------------------------- // Method: CreateGroup() // Description: The CreateGroup method is used to ... // Params: pDPN_GROUP_INFO - // The DPN_GROUP_INFO parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: Destroy() // Description: The Destroy() method is used to automatically destroy the // internal LPIDIRECTPLAY8PEER interface used in the // TDx9_PlayPeer component and should be called when the // internal interface is no longer required. // // Note: This method is called by the component's // destructor. // ---------------------------------------------------------------------- virtual bool __fastcall Destroy(); // ---------------------------------------------------------------------- // Method: DestroyGroup() // Description: The DestroyGroup method is used to ... // Params: pDPNID - // The DPNID parameter ... // pconst - // The const parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: DestroyPeer() // Description: The DestroyPeer method is used to ... // Params: pDPNID - // The DPNID parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: EnumGroupMembers() // Description: The EnumGroupMembers method is used to ... // Params: pDPNID - // The DPNID parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: EnumHosts() // Description: The EnumHosts method is used to ... // Params: pconst - // The const parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: EnumPlayersAndGroups() // Description: The EnumPlayersAndGroups method is used to ... // Params: p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: EnumServiceProviders() // Description: The EnumServiceProviders method is used to ... // Params: pGUID - // The GUID parameter ... // pDPN_SERVICE_PROVIDER_INFO - // The DPN_SERVICE_PROVIDER_INFO parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetApplicationDesc() // Description: The GetApplicationDesc method is used to ... // Params: p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetCaps() // Description: The GetCaps method is used to ... // Params: p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetConnectionInfo() // Description: The GetConnectionInfo method is used to ... // Params: pDPNID - // The DPNID parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetGroupContext() // Description: The GetGroupContext method is used to ... // Params: pDPNID - // The DPNID parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetGroupInfo() // Description: The GetGroupInfo method is used to ... // Params: pDPNID - // The DPNID parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetLocalHostAddresses() // Description: The GetLocalHostAddresses method is used to ... // Params: p**const - // The **const parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetPeerAddress() // Description: The GetPeerAddress method is used to ... // Params: pDPNID - // The DPNID parameter ... // p**const - // The **const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetPeerInfo() // Description: The GetPeerInfo method is used to ... // Params: pDPNID - // The DPNID parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetPlayerContext() // Description: The GetPlayerContext method is used to ... // Params: pDPNID - // The DPNID parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetSPCaps() // Description: The GetSPCaps method is used to ... // Params: pGUID - // The GUID parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: GetSendQueueInfo() // Description: The GetSendQueueInfo method is used to ... // Params: pDPNID - // The DPNID parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: Host() // Description: The Host method is used to ... // Params: pDPN_APPLICATION_DESC - // The DPN_APPLICATION_DESC parameter ... // p**const - // The **const parameter ... // pDWORD - // The DWORD parameter ... // pDPN_SECURITY_DESC - // The DPN_SECURITY_DESC parameter ... // pDPN_SECURITY_CREDENTIALS - // The DPN_SECURITY_CREDENTIALS parameter ... // p*const - // The *const parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: Initialize() // Description: The Initialize method is used to ... // Params: pconst - // The const parameter ... // pPFNDPNMESSAGEHANDLER - // The PFNDPNMESSAGEHANDLER parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: RegisterLobby() // Description: The RegisterLobby method is used to ... // Params: pDPNHANDLE - // The DPNHANDLE parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: RemovePlayerFromGroup() // Description: The RemovePlayerFromGroup method is used to ... // Params: pDPNID - // The DPNID parameter ... // pconst - // The const parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: ReturnBuffer() // Description: The ReturnBuffer method is used to ... // Params: pDPNHANDLE - // The DPNHANDLE parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: SendTo() // Description: The SendTo method is used to ... // Params: pDPNID - // The DPNID parameter ... // pDPN_BUFFER_DESC - // The DPN_BUFFER_DESC parameter ... // pDWORD - // The DWORD parameter ... // p*const - // The *const parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: SetApplicationDesc() // Description: The SetApplicationDesc method is used to ... // Params: pDPN_APPLICATION_DESC - // The DPN_APPLICATION_DESC parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: SetCaps() // Description: The SetCaps method is used to ... // Params: pDPN_CAPS - // The DPN_CAPS parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: SetGroupInfo() // Description: The SetGroupInfo method is used to ... // Params: pDPNID - // The DPNID parameter ... // p*const - // The *const parameter ... // pconst - // The const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: SetPeerInfo() // Description: The SetPeerInfo method is used to ... // Params: pDPN_PLAYER_INFO - // The DPN_PLAYER_INFO parameter ... // pconst - // The const parameter ... // p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: SetSPCaps() // Description: The SetSPCaps method is used to ... // Params: pGUID - // The GUID parameter ... // pDPN_SP_CAPS - // The DPN_SP_CAPS parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Method: TerminateSession() // Description: The TerminateSession method is used to ... // Params: p*const - // The *const parameter ... // pDWORD - // The DWORD parameter ... // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // Constructor() and Destructor() // ---------------------------------------------------------------------- __fastcall TDx9_PlayPeer(TComponent* Owner); virtual __fastcall ~TDx9_PlayPeer(); // ---------------------------------------------------------------------- // The following properties and methods are used internally by // TDx9_Play_Library and should not be used. // ---------------------------------------------------------------------- __property LPIDIRECTPLAY8PEER Internal_LPIDIRECTPLAY8PEER = { read=FGetInternal_LPIDIRECTPLAY8PEER, write=FSetInternal_LPIDIRECTPLAY8PEER, nodefault }; __property LPIDIRECTPLAY8PEER* Internal_LPIDIRECTPLAY8PEER_Ptr = { read=FGetInternal_LPIDIRECTPLAY8PEER_Ptr, nodefault }; void __fastcall Internal_LPIDIRECTPLAY8PEER_Update(); // ========================================================================== protected: // ========================================================================== // ---------------------------------------------------------------------- // Property Access Methods // ---------------------------------------------------------------------- bool __fastcall FGetCreated(); void __fastcall FSetCreated( bool pCreated ); HRESULT __fastcall FGetErrorValue(); void __fastcall FSetErrorValue( HRESULT pErrorValue ); // ========================================================================== private: // ========================================================================== // ---------------------------------------------------------------------- // Internal Interface Access // ---------------------------------------------------------------------- LPIDIRECTPLAY8PEER __fastcall FGetInternal_LPIDIRECTPLAY8PEER(); void __fastcall FSetInternal_LPIDIRECTPLAY8PEER( LPIDIRECTPLAY8PEER pLPIDIRECTPLAY8PEER ); LPIDIRECTPLAY8PEER* __fastcall FGetInternal_LPIDIRECTPLAY8PEER_Ptr(); // ---------------------------------------------------------------------- // Property Variables // ---------------------------------------------------------------------- bool fCreated; HRESULT fErrorValue; // ---------------------------------------------------------------------- // Interface Variables // ---------------------------------------------------------------------- LPIDIRECTPLAY8PEER fLPIDIRECTPLAY8PEER; // ---------------------------------------------------------------------- // Event Variables // ---------------------------------------------------------------------- TDx_Event FOnCreate; TDx_Event FOnDestroy; TDx_Error FOnError; }; // -------------------------------------------------------------------------- #endif // --------------------------------------------------------------------------