beepcnt.cpp

来自「ATL编程的基础用于对基于ATL的OPC服务器的框架,程序基于MFC单文档.」· C++ 代码 · 共 31 行

CPP
31
字号
// BeepCnt.cpp : Implementation of CBeepCnt
#include "stdafx.h"
#include "BeepCntMod.h"
#include "BeepCnt.h"

/////////////////////////////////////////////////////////////////////////////
// CBeepCnt


STDMETHODIMP CBeepCnt::Beep()
{
	for (int i = 0; i < cBeeps; i++)
	{
		MessageBeep((UINT) -1);
		Sleep(1000);
	}
	return S_OK;
}

STDMETHODIMP CBeepCnt::get_Count(long *pVal)
{
	*pVal = cBeeps;
	return S_OK;
}

STDMETHODIMP CBeepCnt::put_Count(long newVal)
{
	cBeeps = newVal;
	return S_OK;
}

⌨️ 快捷键说明

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