mycomponentvcr.cpp

来自「【内容简介】 本书由一流的权威撰写」· C++ 代码 · 共 34 行

CPP
34
字号
// MyComponentVCR.cpp : Implementation of CComponentVCRApp and DLL registration.

#include "stdafx.h"
#include "ComponentVCR.h"
#include "MyComponentVCR.h"

/////////////////////////////////////////////////////////////////////////////
//

CComponentVCR::CComponentVCR()
{
	m_lCurValue = 5; 
	m_nCurCount = 0;
}

STDMETHODIMP CComponentVCR::GetCVideoSignalValue(long *pRetVal)
{
	if (m_nCurCount >= 5 || m_nCurCount < 0) {
		return E_UNEXPECTED;
	}

	m_nCurCount++;
	if (5 == m_nCurCount ) {
		m_lCurValue = 5;
		m_nCurCount = 1;
	}

	long lReturnValue = m_lCurValue;
	m_lCurValue += 30;
	*pRetVal = lReturnValue;

	return S_OK;
}

⌨️ 快捷键说明

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