Download Source Code

CNetDispatch Class Reference

Provides network callback capability. More...

#include <NetDispatch.h>

Collaboration diagram for CNetDispatch:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void SetNetwork (CNetCmd *pNc, const GUID *pguidClass)
 Call to set the network object this class should use.
CMessageListGetNetwork ()
 Returns a pointer to the attached network object.
void Destroy ()
 Unhooks from the network and releases all resources.
 CNetDispatch ()
 Default constructor.
 CNetDispatch (CNetCmd *pNc)
 Constructs the object and hooks the specified network object.
virtual ~CNetDispatch ()
 Destructor.
long OnNetMsg (WPARAM wParam, LPARAM lParam)
 Resolved callback function that handles network notifications.
virtual BOOL OnMsg (DWORD dwFunction, CNetCom *pNc)=0
 Over-ride to supply custom message handling.
BOOL IsNetwork ()
 Returns non-zero if there is an attached CNetCmd object.
CNetCmdNet ()
 Returns a pointer to the attached CNetCmd object.

Static Public Member Functions

static long NetMsg (LPVOID pData, WPARAM wParam, LPARAM lParam)
 Callback function that handles network notifications.

Detailed Description

Provides network callback capability.

Inherit from this class to provide network accessable functionality.


Constructor & Destructor Documentation

CNetDispatch::CNetDispatch CNetCmd pNc  ) 
 

Constructs the object and hooks the specified network object.

Parameters:
[in] pNc - CNetCmd network object to hook


Member Function Documentation

long CNetDispatch::NetMsg LPVOID  pData,
WPARAM  wParam,
LPARAM  lParam
[static]
 

Callback function that handles network notifications.

Parameters:
[in] pData - CNetCom class pointer
[in] wParam - Message WPARAM value
[in] lParam - Message LPARAM value
Returns:
Message return value
See also:

virtual BOOL CNetDispatch::OnMsg DWORD  dwFunction,
CNetCom pNc
[pure virtual]
 

Over-ride to supply custom message handling.

Parameters:
[in] dwFunction - Function ID
[in] pNc - CNetCom object
Process the command in dwFunction. Call pNc->GetParams(), pNc->ReadPacketData(), pNc->ReadPacketString(), etc... to retreive message information.

Use pNc->Msg() to send replies.

Returns:
Non-zero if message is processed
See also:

long CNetDispatch::OnNetMsg WPARAM  wParam,
LPARAM  lParam
 

Resolved callback function that handles network notifications.

Parameters:
[in] wParam - Message WPARAM value
[in] lParam - Message LPARAM value
Returns:
Message return value
See also:

void CNetDispatch::SetNetwork CNetCmd pNc,
const GUID *  pguidClass
[virtual]
 

Call to set the network object this class should use.

Parameters:
[in] pNc - Pointer to a valid CNetCmd object
[in] pguidClass - The class ID for messages this class intends to receive.


The documentation for this class was generated from the following files:
  • inc/NetDispatch.h
  • NetDispatch.cpp
Copyright Robert Umbehant
This documentation is covered by the LGPL