⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tapi3app.cpp

📁 基于Tapi 3.0的软电话源代码
💻 CPP
字号:
//-----------------------------------------------------------------------
//  Copyright (c) 2002 Avaya Global SME Solutions 
//-----------------------------------------------------------------------
//  Project name: TAPI 3 Test Harness
//  Module file : Tapi3.cpp
//  Compiler    : Visual C++ 6.0
//-----------------------------------------------------------------------
//  Description : Defines the class behaviors for the application.
//                Application is dialog based and this class creates modal 
//                dialog box and provides methods for printing information
//                in dialog's list boxes 
//-----------------------------------------------------------------------

#include "stdafx.h"
#include "Tapi3app.h"
#include "Tapi3Dlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

BEGIN_MESSAGE_MAP(CTapi3App, CWinApp)
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

// CTapi3App construction
CTapi3App::CTapi3App()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}

// The one and only CTapi3App object
CTapi3App theApp;
static CTapi3Dlg* dlg;

// CTapi3App initialization
BOOL CTapi3App::InitInstance()
{
	AfxEnableControlContainer();

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	// of your final executable, you should remove from the following
	// the specific initialization routines you do not need.

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	dlg = new CTapi3Dlg();
	m_pMainWnd = dlg;
	int nResponse = dlg->DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		// dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		// dismissed with Cancel
	}
	
	delete dlg;

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump
	return FALSE;
}

int CTapi3App::PrintMsg(int index, int level, char *str, ...)
{
    char msgbuf[400];
    msgbuf[0] = 0;

    char *cp = &msgbuf[0];
    va_list vargs;
    va_start(vargs, str);
    vsprintf(cp, str, vargs);

	return dlg->PrintMsg(index, level, cp);
}

int CTapi3App::PrintMsgInit(int index, int level, char *str, ...)
{
    char msgbuf[400];
    msgbuf[0] = 0;

    char *cp = &msgbuf[0];
    va_list vargs;
    va_start(vargs, str);
    vsprintf(cp, str, vargs);

	return dlg->PrintMsgInit(index, level, cp);
}


void CTapi3App::SetItemDataPtr(int Index, void* p)
{
	dlg->SetItemDataPtr(Index, p);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -