// -------------------------------------------------------------------------- // ========================================================================== // File: TDPN_Connection_Info.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 TDPN_Connection_Info // 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. // ========================================================================== // -------------------------------------------------------------------------- // #includes ... // -------------------------------------------------------------------------- #include #pragma hdrstop // -------------------------------------------------------------------------- #include "TDPN_Connection_Info.H" // -------------------------------------------------------------------------- #pragma link "TDx_Library_Defns" #pragma link "TDx_Library_Functions" #pragma link "TDx9_Play_Library_Defns" #pragma link "TDx9_Play_Library_Functions" // -------------------------------------------------------------------------- // Object Registration... // -------------------------------------------------------------------------- #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ #pragma package(smart_init) #endif // -------------------------------------------------------------------------- static inline void ValidCtrCheck(TDPN_Connection_Info*) { new TDPN_Connection_Info(NULL); } // -------------------------------------------------------------------------- namespace Tdpn_connection_info { #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ void __fastcall PACKAGE Register() #else void __fastcall Register() #endif { TComponentClass classes[1] = {__classid(TDPN_Connection_Info)}; RegisterComponents("", classes, 0); } } // -------------------------------------------------------------------------- // Constructor: TDPN_Connection_Info::TDPN_Connection_Info() // Description: The default constructor for the TDPN_Connection_Info object. // -------------------------------------------------------------------------- __fastcall TDPN_Connection_Info::TDPN_Connection_Info(TComponent* Owner) : TComponent(Owner) { Clear(); } // -------------------------------------------------------------------------- // Destructor: TDPN_Connection_Info::~TDPN_Connection_Info() // Description: The destructor for the TDPN_Connection_Info object. // -------------------------------------------------------------------------- __fastcall TDPN_Connection_Info::~TDPN_Connection_Info() { } // -------------------------------------------------------------------------- // Property: BytesDropped // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetBytesDropped() { return fDPN_CONNECTION_INFO.dwBytesDropped; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetBytesDropped( dword pBytesDropped ) { fDPN_CONNECTION_INFO.dwBytesDropped = pBytesDropped; } // -------------------------------------------------------------------------- // Property: BytesReceivedGuaranteed // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetBytesReceivedGuaranteed() { return fDPN_CONNECTION_INFO.dwBytesReceivedGuaranteed; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetBytesReceivedGuaranteed( dword pBytesReceivedGuaranteed ) { fDPN_CONNECTION_INFO.dwBytesReceivedGuaranteed = pBytesReceivedGuaranteed; } // -------------------------------------------------------------------------- // Property: BytesReceivedNonGuaranteed // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetBytesReceivedNonGuaranteed() { return fDPN_CONNECTION_INFO.dwBytesReceivedNonGuaranteed; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetBytesReceivedNonGuaranteed( dword pBytesReceivedNonGuaranteed ) { fDPN_CONNECTION_INFO.dwBytesReceivedNonGuaranteed = pBytesReceivedNonGuaranteed; } // -------------------------------------------------------------------------- // Property: BytesRetried // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetBytesRetried() { return fDPN_CONNECTION_INFO.dwBytesRetried; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetBytesRetried( dword pBytesRetried ) { fDPN_CONNECTION_INFO.dwBytesRetried = pBytesRetried; } // -------------------------------------------------------------------------- // Property: BytesSentGuaranteed // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetBytesSentGuaranteed() { return fDPN_CONNECTION_INFO.dwBytesSentGuaranteed; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetBytesSentGuaranteed( dword pBytesSentGuaranteed ) { fDPN_CONNECTION_INFO.dwBytesSentGuaranteed = pBytesSentGuaranteed; } // -------------------------------------------------------------------------- // Property: BytesSentNonGuaranteed // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetBytesSentNonGuaranteed() { return fDPN_CONNECTION_INFO.dwBytesSentNonGuaranteed; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetBytesSentNonGuaranteed( dword pBytesSentNonGuaranteed ) { fDPN_CONNECTION_INFO.dwBytesSentNonGuaranteed = pBytesSentNonGuaranteed; } // -------------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TDPN_Connection_Info method or // fget/fset. eg. or DDERR_SURFACELOST or TDX_ERROR // -------------------------------------------------------------------------- HRESULT __fastcall TDPN_Connection_Info::FGetErrorValue() { return fErrorValue; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetErrorValue( HRESULT pErrorValue ) { fErrorValue = pErrorValue; } // -------------------------------------------------------------------------- // Property: MessagesReceived // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetMessagesReceived() { return fDPN_CONNECTION_INFO.dwMessagesReceived; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetMessagesReceived( dword pMessagesReceived ) { fDPN_CONNECTION_INFO.dwMessagesReceived = pMessagesReceived; } // -------------------------------------------------------------------------- // Property: MessagesTimedOutHighPriority // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetMessagesTimedOutHighPriority() { return fDPN_CONNECTION_INFO.dwMessagesTimedOutHighPriority; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetMessagesTimedOutHighPriority( dword pMessagesTimedOutHighPriority ) { fDPN_CONNECTION_INFO.dwMessagesTimedOutHighPriority = pMessagesTimedOutHighPriority; } // -------------------------------------------------------------------------- // Property: MessagesTimedOutLowPriority // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetMessagesTimedOutLowPriority() { return fDPN_CONNECTION_INFO.dwMessagesTimedOutLowPriority; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetMessagesTimedOutLowPriority( dword pMessagesTimedOutLowPriority ) { fDPN_CONNECTION_INFO.dwMessagesTimedOutLowPriority = pMessagesTimedOutLowPriority; } // -------------------------------------------------------------------------- // Property: MessagesTimedOutNormalPriority // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetMessagesTimedOutNormalPriority() { return fDPN_CONNECTION_INFO.dwMessagesTimedOutNormalPriority; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetMessagesTimedOutNormalPriority( dword pMessagesTimedOutNormalPriority ) { fDPN_CONNECTION_INFO.dwMessagesTimedOutNormalPriority = pMessagesTimedOutNormalPriority; } // -------------------------------------------------------------------------- // Property: MessagesTransmittedHighPriority // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetMessagesTransmittedHighPriority() { return fDPN_CONNECTION_INFO.dwMessagesTransmittedHighPriority; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetMessagesTransmittedHighPriority( dword pMessagesTransmittedHighPriority ) { fDPN_CONNECTION_INFO.dwMessagesTransmittedHighPriority = pMessagesTransmittedHighPriority; } // -------------------------------------------------------------------------- // Property: MessagesTransmittedLowPriority // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetMessagesTransmittedLowPriority() { return fDPN_CONNECTION_INFO.dwMessagesTransmittedLowPriority; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetMessagesTransmittedLowPriority( dword pMessagesTransmittedLowPriority ) { fDPN_CONNECTION_INFO.dwMessagesTransmittedLowPriority = pMessagesTransmittedLowPriority; } // -------------------------------------------------------------------------- // Property: MessagesTransmittedNormalPriority // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetMessagesTransmittedNormalPriority() { return fDPN_CONNECTION_INFO.dwMessagesTransmittedNormalPriority; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetMessagesTransmittedNormalPriority( dword pMessagesTransmittedNormalPriority ) { fDPN_CONNECTION_INFO.dwMessagesTransmittedNormalPriority = pMessagesTransmittedNormalPriority; } // -------------------------------------------------------------------------- // Property: PacketsDropped // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetPacketsDropped() { return fDPN_CONNECTION_INFO.dwPacketsDropped; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetPacketsDropped( dword pPacketsDropped ) { fDPN_CONNECTION_INFO.dwPacketsDropped = pPacketsDropped; } // -------------------------------------------------------------------------- // Property: PacketsReceivedGuaranteed // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetPacketsReceivedGuaranteed() { return fDPN_CONNECTION_INFO.dwPacketsReceivedGuaranteed; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetPacketsReceivedGuaranteed( dword pPacketsReceivedGuaranteed ) { fDPN_CONNECTION_INFO.dwPacketsReceivedGuaranteed = pPacketsReceivedGuaranteed; } // -------------------------------------------------------------------------- // Property: PacketsReceivedNonGuaranteed // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetPacketsReceivedNonGuaranteed() { return fDPN_CONNECTION_INFO.dwPacketsReceivedNonGuaranteed; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetPacketsReceivedNonGuaranteed( dword pPacketsReceivedNonGuaranteed ) { fDPN_CONNECTION_INFO.dwPacketsReceivedNonGuaranteed = pPacketsReceivedNonGuaranteed; } // -------------------------------------------------------------------------- // Property: PacketsRetried // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetPacketsRetried() { return fDPN_CONNECTION_INFO.dwPacketsRetried; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetPacketsRetried( dword pPacketsRetried ) { fDPN_CONNECTION_INFO.dwPacketsRetried = pPacketsRetried; } // -------------------------------------------------------------------------- // Property: PacketsSentGuaranteed // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetPacketsSentGuaranteed() { return fDPN_CONNECTION_INFO.dwPacketsSentGuaranteed; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetPacketsSentGuaranteed( dword pPacketsSentGuaranteed ) { fDPN_CONNECTION_INFO.dwPacketsSentGuaranteed = pPacketsSentGuaranteed; } // -------------------------------------------------------------------------- // Property: PacketsSentNonGuaranteed // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetPacketsSentNonGuaranteed() { return fDPN_CONNECTION_INFO.dwPacketsSentNonGuaranteed; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetPacketsSentNonGuaranteed( dword pPacketsSentNonGuaranteed ) { fDPN_CONNECTION_INFO.dwPacketsSentNonGuaranteed = pPacketsSentNonGuaranteed; } // -------------------------------------------------------------------------- // Property: PeakThroughputBPS // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetPeakThroughputBPS() { return fDPN_CONNECTION_INFO.dwPeakThroughputBPS; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetPeakThroughputBPS( dword pPeakThroughputBPS ) { fDPN_CONNECTION_INFO.dwPeakThroughputBPS = pPeakThroughputBPS; } // -------------------------------------------------------------------------- // Property: RoundTripLatencyMS // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetRoundTripLatencyMS() { return fDPN_CONNECTION_INFO.dwRoundTripLatencyMS; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetRoundTripLatencyMS( dword pRoundTripLatencyMS ) { fDPN_CONNECTION_INFO.dwRoundTripLatencyMS = pRoundTripLatencyMS; } // -------------------------------------------------------------------------- // Property: Size // Description: The Size property contains the size in bytes of the internal // _DPN_CONNECTION_INFO structure. // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetSize() { return fSize; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetSize( dword pSize ) { fSize = pSize; } // -------------------------------------------------------------------------- // Property: ThroughputBPS // Description: ... // -------------------------------------------------------------------------- dword __fastcall TDPN_Connection_Info::FGetThroughputBPS() { return fDPN_CONNECTION_INFO.dwThroughputBPS; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetThroughputBPS( dword pThroughputBPS ) { fDPN_CONNECTION_INFO.dwThroughputBPS = pThroughputBPS; } // -------------------------------------------------------------------------- // Method: Clear() // Description: The Clear() method can be used to clear the contents of the // TDPN_Connection_Info's internal DPN_CONNECTION_INFO // 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 TDPN_Connection_Info::Clear() { fDPN_CONNECTION_INFO.dwBytesDropped = 0; fDPN_CONNECTION_INFO.dwBytesReceivedGuaranteed = 0; fDPN_CONNECTION_INFO.dwBytesReceivedNonGuaranteed = 0; fDPN_CONNECTION_INFO.dwBytesRetried = 0; fDPN_CONNECTION_INFO.dwBytesSentGuaranteed = 0; fDPN_CONNECTION_INFO.dwBytesSentNonGuaranteed = 0; fErrorValue = ; fDPN_CONNECTION_INFO.dwMessagesReceived = 0; fDPN_CONNECTION_INFO.dwMessagesTimedOutHighPriority = 0; fDPN_CONNECTION_INFO.dwMessagesTimedOutLowPriority = 0; fDPN_CONNECTION_INFO.dwMessagesTimedOutNormalPriority = 0; fDPN_CONNECTION_INFO.dwMessagesTransmittedHighPriority = 0; fDPN_CONNECTION_INFO.dwMessagesTransmittedLowPriority = 0; fDPN_CONNECTION_INFO.dwMessagesTransmittedNormalPriority = 0; fDPN_CONNECTION_INFO.dwPacketsDropped = 0; fDPN_CONNECTION_INFO.dwPacketsReceivedGuaranteed = 0; fDPN_CONNECTION_INFO.dwPacketsReceivedNonGuaranteed = 0; fDPN_CONNECTION_INFO.dwPacketsRetried = 0; fDPN_CONNECTION_INFO.dwPacketsSentGuaranteed = 0; fDPN_CONNECTION_INFO.dwPacketsSentNonGuaranteed = 0; fDPN_CONNECTION_INFO.dwPeakThroughputBPS = 0; fDPN_CONNECTION_INFO.dwRoundTripLatencyMS = 0; fSize = sizeof(_DPN_CONNECTION_INFO); fDPN_CONNECTION_INFO.dwThroughputBPS = 0; } // -------------------------------------------------------------------------- // Internal Structure Access // -------------------------------------------------------------------------- DPN_CONNECTION_INFO* __fastcall TDPN_Connection_Info::FGetInternal_DPN_CONNECTION_INFO_Ptr() { return &fDPN_CONNECTION_INFO; } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::FSetInternal_DPN_CONNECTION_INFO( DPN_CONNECTION_INFO* pDPN_CONNECTION_INFO ) { if (pDPN_CONNECTION_INFO==NULL) { fErrorValue = TDX_ERROR; if (FOnError) FOnError(this, "TDPN_Connection_Info::FSetInternal_DPN_CONNECTION_INFO()", "TDX_ERROR", "The supplied DPN_CONNECTION_INFO* was NULL" ); return; } CopyMemory( &fDPN_CONNECTION_INFO, pDPN_CONNECTION_INFO, sizeof(DPN_CONNECTION_INFO) ); Internal_DPN_CONNECTION_INFO_Update(); } // -------------------------------------------------------------------------- void __fastcall TDPN_Connection_Info::Internal_DPN_CONNECTION_INFO_Update() { } // --------------------------------------------------------------------------