home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
kvfon3.exe
/
FORWARD.H
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-22
|
5KB
|
155 lines
/****************************************************************************
** File: FORWARD.H
**
** Desc: Include files for the dialpad program.
**
** This file is an include file for the dialpad program. It contains the
** dialog source for forwarding your calls to another extension.
**
** It is written for OWL 2.0 with Borland C++ 4.x. To compile this program,
** create a project in BC4.x, similar to the .IDE project file included.
**
** DISCLAIMER
**
** Novell, Inc. makes no representations or warranties with respect to
** any NetWare software, and specifically disclaims any express or
** implied warranties of merchantability, title, or fitness for a
** particular purpose.
**
** You may use this sample code in your own programs.
**
** Distribution of any NetWare software is forbidden without the
** express written consent of Novell, Inc. Further, Novell reserves
** the right to discontinue distribution of any NetWare software.
**
** Novell is not responsible for lost profits or revenue, loss of use
** of the software, loss of data, costs of re-creating lost data, the
** cost of any substitute equipment or program, or claims by any party
** other than you. Novell strongly recommends a backup be made before
** any software is installed. Technical support for this software
** may be provided at the discretion of Novell.
**
** Programmers:
**
** Ini Who Firm
** -----------------------------------------------------------------------
** KVW Kevin V White Novell Developer Support.
**
** History:
**
** When Who What
** -----------------------------------------------------------------------
** 11-22 KVW This feature is new
*/
/****************************************************************************
** This is the forward dialog's class.
*/
class TForward:public TDialog
{
public:
ACSHandle_t globalACSHandle;
DeviceID_t forwardExt,callerExt;
CSTAEvent_t eventBuffer;
unsigned short eventBufferSize;
unsigned short numEvents;
RetCode_t rCode;
InvokeID_t invokeID;
TEdit *extEntryBox;
BOOL *ForwardStatus;
TForward(TWindow *parent,TResId resId,ACSHandle_t *acsHandle,
DeviceID_t *caller,BOOL *currentStatus);
void SetupWindow();
void CleanupWindow();
void CmForward();
DECLARE_RESPONSE_TABLE(TForward);
};
/****************************************************************************
** this is how OWL adds message handling to the windows message loop
*/
DEFINE_RESPONSE_TABLE1(TForward,TDialog)
EV_COMMAND(IDOK,CmForward),
END_RESPONSE_TABLE;
/****************************************************************************
** constructor for the transfer call dialog
*/
TForward::TForward(TWindow *parent,TResId resId,ACSHandle_t *acsHandle,
DeviceID_t *caller,BOOL *currentStatus)
:TDialog(parent,resId),TWindow(parent)
{
globalACSHandle=*acsHandle;
strcpy(callerExt,*caller);
ForwardStatus=currentStatus;
}
/****************************************************************************
** SetupWindow is called when the dialog window is created
*/
void TForward::SetupWindow()
{
/*------------------------------------------------------------------------
** first, call the parent's SetupWindow
*/
TDialog::SetupWindow();
/*------------------------------------------------------------------------
** create an alias to the text box in the dialog, as the alias will be
** easier to enter text into and retrieve text from than the dialog
*/
extEntryBox=new TEdit(this,IDC_EDIT1,30);
extEntryBox->Create();
}
/****************************************************************************
** CleanupWindow is called when the window is destroyed. We just use it to
** free the memory allocated to our TEdit alias in SetupWindow, then call
** the parent's CleanupWindow
*/
void TForward::CleanupWindow()
{
delete extEntryBox;
TDialog::CleanupWindow();
}
/****************************************************************************
** Here we actually forward the calls
*/
void TForward::CmForward()
{
/*-----------------------------------------------------------------------
** get the extension to forward to
*/
extEntryBox->GetLine(forwardExt,30,0);
if(strlen(forwardExt)>0)
{
*ForwardStatus=TRUE;
rCode=cstaSetForwarding(globalACSHandle,invokeID,&callerExt,
FWD_IMMEDIATE,TRUE,&forwardExt,NULL);
if(rCode>0)
{
eventBufferSize=sizeof(CSTAEvent_t);
rCode=acsGetEventBlock(globalACSHandle,&eventBuffer,&eventBufferSize,
NULL,&numEvents);
if(rCode==ACSPOSITIVE_ACK)
{
}
else
{
MessageBox("Event returned wrong","Forward Calls");
}
}
else
{
MessageBox("Cannot Turn On Forward Calls","Forward Calls Error");
}
}
TDialog::CmOk();
return;
}