本文介绍了RangePtr和Range *有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对excel自动化还比较陌生,而且我必须做自动化项目.
此代码表明RangePtrRange *不同.

I am relatively new to excel automation, And I have to do automation projects.
This code shows that RangePtr and Range * differ.

Exell::_WorksheetPtr pSheet;
Excel::RangePtr pRangeA1 = pSheet->Cells->Item[1][1];
Excel::RangePtr pRangeB2 = pSheet->Cells->Item[2][2];
Excel::RangePtr pRange1 = pSheet->Range[(Range*)pRangeA1][(Range*)pRangeB2];//ok
Exell::RangePtr pRange2 = pSheet->Range[pRangeA1][pRangeA2];//causes error:
/*
error C2664: ''Excel::_Worksheet::GetRange'' : cannot convert parameter 1 from ''Excel::RangePtr'' to ''const _variant_t &''
*/


这意味着Range *会转换为_variant_t &,而RangePtr不会.
我没有找到RangePtr iGwtRangen的声明* .tlh,*.tli,VC ++包含目录.
有人可以帮我吗?
在此先感谢
abzadeh


It means that Range * converts to _variant_t & and RangePtr doesn''t.
I didn''t find Declaration for RangePtr iGwtRangen *.tlh, *.tli, VC++ include directories.
Can anybody help me?
Thanks in advance
abzadeh

推荐答案


这篇关于RangePtr和Range *有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 21:15