本文整理汇总了C++中CComSafeArray::CopyFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ CComSafeArray::CopyFrom方法的具体用法?C++ CComSafeArray::CopyFrom怎么用?C++ CComSafeArray::CopyFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComSafeArray
的用法示例。
在下文中一共展示了CComSafeArray::CopyFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBnClickedSelect
void CRegionDlg::OnBnClickedSelect()
{
UpdateData();
ShowWindow(SW_HIDE);
CRect rcCapture;
CComPtr<ITSelectionInfo> pSelInfo;
CComSafeArray<VARIANT, VT_VARIANT> arSafePoints;
int nCount = 0;
LONG hWnd = NULL;
VARIANT points;
if (!theApp.Select(tsSelectionRectangle, pSelInfo))
{
goto Exit;
}
// Capture region
hWnd = pSelInfo->WindowHandle;
pSelInfo->get_Points(&points);
// Ttransform safe arry points
arSafePoints.CopyFrom(points.parray);
nCount = (int)arSafePoints.GetCount();
ATLASSERT(2 == nCount);
if (2 != nCount)
{
goto Exit;
}
rcCapture.SetRect(GET_X_LPARAM(arSafePoints[0].lVal), GET_Y_LPARAM(arSafePoints[0].lVal),
GET_X_LPARAM(arSafePoints[1].lVal), GET_Y_LPARAM(arSafePoints[1].lVal));
// Fill the values
m_strWindowName = theApp.GetWindowText((HWND)(LONG_PTR)hWnd);
m_strWindowHandle.Format(_T("%X"), hWnd);
m_nX = rcCapture.left;
m_nY = rcCapture.top;
m_nWidth = rcCapture.Width();
m_nHeight = rcCapture.Height();
// Capture
DoCapture(hWnd, rcCapture);
UpdateData(FALSE);
Exit:
if (m_nFullHeight > 0)
{
//restore the window
theApp.RestoreWindow(this, m_nFullHeight);
m_nFullHeight = 0;
}
ShowWindow(SW_SHOW);
}