我在Mmsdemo1appui.cpp中按照范例(group)的方式打入,
TBuf<KAknExQueryTextBufLength> labelText;
iCoeEnv->ReadResource( labelText,R_AKNEXQUERY_LIST_SINGLE_PANE);
iLabelResultMessage->SetTextL(labelText);
error为:
\SYMBIAN\6.1\SERIES60\EPOC32EX\MMSDEMO1\SRC\Mmsdemo1appui.cpp(124) : error C2664: 'void __thiscall CCoeControl::SetContainerWindowL(const class CCoeControl &)' : cannot convert parameter 1 from 'class CMMSDemo1AppUi' to 'const class CCoeControl &'
Reason: cannot convert from 'class CMMSDemo1AppUi' to 'const class CCoeControl'
No constructor could take the source type, or constructor overload resolution was ambiguous
\SYMBIAN\6.1\SERIES60\EPOC32EX\MMSDEMO1\SRC\Mmsdemo1appui.cpp(394) : error C2361: initialization of 'labelText' is skipped by 'default' label
\SYMBIAN\6.1\SERIES60\EPOC32EX\MMSDEMO1\SRC\Mmsdemo1appui.cpp(390) : see declaration of 'labelText'
不知是怎么回事?
另外,程序码中的iCoeEnv又是代表什么呢?
谢谢您的帮忙^^a
You have shown two errors. The first one has nothing to do with your code here, maybe you ignore some of them. It is telling you that you shall not call the SetContainerWindowL(*this) with the wrong parameter type. Very likely you call this function in some of the CMMSDemo1AppUi class member functions, which is class is not a CCoeControl class. The correct place to call this function is in the member function of CMMSDemo1MainContainer, which is a CCoeControl class.
The second one, is caused by the first error. Because of the first error, your label is not correctly initialized, so you can not set the text.
iCoeEnv is a instance of CCoeEnv. You can read the SDK.
"iCoeEnv" is define as a pointer of " CCoeEnv", and it is a member variable for the class of "CAknAppUi". Please refer to its header ("coeaui.h")
From your dump, apparently, your error is located at the following location:
cannot convert parameter 1 from 'class CMMSDemo1AppUi' to 'const class CCoeControl &'
Reason: cannot convert from 'class CMMSDemo1AppUi' to 'const class CCoeControl'
Please locate your code to correct your problem. It seems that it does not have anything to do with yout added code (posted one).