| Reply | « Previous Thread | Next Thread » |
|
Hi!
I'm trying to use the camerawrapper to do a app that works like a camera. I'm starting, and I'm using the example code of the package Camera wrapper example. When I use it... I get the next compilation error: 1256946905812 illegal implicit conversion from 'CviewfinderactivoView *' 'MCameraEngineObserver *' ViewfinderactivoView.cpp I have created a project, and i want to show the viewfinder (for the moment) in the viewfinderactivo. For that, in the construct method I call to the initViewFinder() function. Here it is: Code:
int CviewfinderactivoView::initViewFinder(){
TInt camErr(KErrNotSupported);
//Si no hemos definido la cámara anteriormente
if(iCameraWrapper==NULL){
//Si hay cámaras disponibles
if(CCameraEngine::CamerasAvailable() > 0)
{
//Intentamos activar la cámara.
TRAP(camErr, iCameraWrapper = CCameraEngine::NewL(0,0,this));
}
//Preguntar por camErr...
//Establecemos tamaño de captura y de ViewFinder (Por ahora, modo portrait)
iViewFinderSize = TSize(Rect().Size().iWidth,Rect().Size().iWidth);
iCaptureSize = TSize(1280,960);
if (iCameraWrapper->State() == CCameraEngine::EEngineIdle)
{
// Prepare camera
TRAPD(err,iCameraWrapper->PrepareL(iCaptureSize));
if (err){
//SetError(_L("Camera prepare error %d"), err);
return;
}
// Start viewfinder. Viewfinder pictures starts coming into MceoViewFinderFrameReady();
TRAPD(err2,iCameraWrapper->StartViewFinderL(iViewFinderSize));
if (err2)
{
// SetError(_L("Camera start viewfinder error %d"), err2);
return;
}
//SetTitle(_L("Camera viewfinder"));
}
}
}
Code:
CCameraEngine* iCameraWrapper; TSize iViewFinderSize; TSize iCaptureSize; #include <cameraengine.h> #include <cameraengineobserver.h> I have added the libs: camerawrapper.lib ecam.lib To the .mmp file. Thank! |
|
Join Date: Feb 2006
Posts: 16,386
Location: Zürich, Switzerland
Offline
Forum Nokia Champion
|
|
Make sure that your class CviewfinderactivoView inherits from (and implements) MCameraEngineObserver.
|
| wizard_hu_ |
| View Public Profile |
| Find all posts by wizard_hu_ |
|
Ok, thanks!
Now I have added it and I have: class CviewfinderactivoView : public CAknView, public MCameraEngineObserver, public CCoeControl (This one for the TRect) I have added too to the private part: void MceoCameraReady(); But I have errors too, it must be derived by the inherits..I think here: Code:
CviewfinderactivoView* CviewfinderactivoView::NewLC()
{
1 CviewfinderactivoView* self = new ( ELeave ) CviewfinderactivoView();
2 CleanupStack::PushL( self );
1 illegal use of abstract class ('MCameraEngineObserver::MceoFocusComplete()') 2 ambiguous access from 'CviewfinderactivoView' to 'CBase' Comparing with the example, I have it equal. Another error here: Code:
void CviewfinderactivoView::DoActivateL(
const TVwsViewId& /*aPrevViewId*/,
TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/ )
{
// [[[ begin generated region: do not modify [Generated Contents]
SetupStatusPaneL();
if ( iViewfinderactivo == NULL )
{
iViewfinderactivo = CreateContainerL();
-> iViewfinderactivo->SetMopParent( this );
AppUi()->AddToStackL( *this, iViewfinderactivo );
}
// ]]] end generated region [Generated Contents]
}
And here Code:
void CviewfinderactivoView::SetupStatusPaneL()
{
// reset the context pane
TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
CEikStatusPaneBase::TPaneCapabilities subPaneContext =
StatusPane()->PaneCapabilities( contextPaneUid );
if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
{
CAknContextPane* context = static_cast< CAknContextPane* > (
StatusPane()->ControlL( contextPaneUid ) );
context->SetPictureToDefaultL();
}
// setup the title pane
TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
CEikStatusPaneBase::TPaneCapabilities subPaneTitle =
StatusPane()->PaneCapabilities( titlePaneUid );
if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
{
CAknTitlePane* title = static_cast< CAknTitlePane* >(
StatusPane()->ControlL( titlePaneUid ) );
TResourceReader reader;
-> iEikonEnv->CreateResourceReaderLC( reader, R_VIEWFINDERACTIVO_TITLE_RESOURCE );
title->SetFromResourceL( reader );
CleanupStack::PopAndDestroy(); // reader internal state
}
}
1256948692187 ambiguous access to name found 'CAknView::iCoeEnv' and 'CCoeControl::iCoeEnv' Thanks! |
|
Join Date: Feb 2006
Posts: 16,386
Location: Zürich, Switzerland
Offline
Forum Nokia Champion
|
|||
|
Quote:
Quote:
Quote:
|
| wizard_hu_ |
| View Public Profile |
| Find all posts by wizard_hu_ |
|
Ah, ok, thanks!
That's what I have done: Copy the contents of the file camerawrapperexample.h and .c to my project files called cameradecodercontain.h and .c Changing all ccamerawapperexample for the ccameradecodercontain. I have added all the libraries said in the mmp of the example. And finally I get those errors: 1257269181968 illegal use of incomplete struct/union/class 'CCamaradecoderContainerAppUi' (4 times) In those lines: iAppUi = static_cast<CCamaradecoderContainerAppUi*>(iEikonEnv->EikAppUi()); iAppUi->UseOptionsExitCbaL(); TRAP_IGNORE(iAppUi->UseOptionsBackCbaL()); iAppUi->UseOptionsExitCbaL(); iAppUi declaration: private: // Data CCamaradecoderContainerAppUi* iAppUi; Thanks! |
|
Join Date: Feb 2006
Posts: 16,386
Location: Zürich, Switzerland
Offline
Forum Nokia Champion
|
|
You probably have a "class CCamaradecoderContainerAppUi;" line somewhere in the beginning of cameradecodercontain.h. That is called a forward declaration, enabling to refer CCamaradecoderContainerAppUi as a pointer variable for example.
However it is not enough for 'real' usage in the .cpp file, there you have to #include the real .h file containing the declaration of it. (perhaps #include "CamaradecoderContainerAppUi.h") |
| wizard_hu_ |
| View Public Profile |
| Find all posts by wizard_hu_ |
|
Thanks!
yes, I have already put it in the camaradecodercontainer.cpp. So, it mustn't be... :S Thank you so much! |
|
Join Date: Feb 2006
Posts: 16,386
Location: Zürich, Switzerland
Offline
Forum Nokia Champion
|
|
Check your guard macros then, make sure that they are unique for each .h file.
|
| wizard_hu_ |
| View Public Profile |
| Find all posts by wizard_hu_ |
|
I have fixed the problem. It was that the class contained on the cameradecoderAppUi was called CCameradecoderAppUi, not CCameradecoderContainerAppUi. So I use the CCameradecoderAppUi in the CCcameradecodercontainer.h and .c
Now I get: undefined indentifier "UseOptionsExitCbaL" undefined indentifier "UseOptionBackCbaL" On iAppUi->UseOptionsExitCbaL iAppUi->UseOptionsBackCbaL Thanks! |
|
Join Date: Feb 2006
Posts: 16,386
Location: Zürich, Switzerland
Offline
Forum Nokia Champion
|
|
Undefined identifier means that you either do not have such methods at all, or they use some slightly different spelling, arguments, etc. than what you have tried.
|
| wizard_hu_ |
| View Public Profile |
| Find all posts by wizard_hu_ |
|
Hello!
Thanks, now it's compile. But now..I have a problem in the executing... :S I have been debugging and I know where it stops, but I don't know why. I'm going to explain you a bit the classes: CCamera1View -> Class view of the camera wrapper. It's made in a 99% by carbide. CCamera1 -> Class container. It's the example of the camera wrapper, only changing the names. At debugging I do a change of view from Initial one to the CCamera1View, where it's done to show the viewfinder. CCamera1View create a CCamera1: Code:
CCamara1* Ccamara1View::CreateContainerL()
{
return CCamara1::NewL( ClientRect());
}
Code:
CCamara1* CCamara1::NewL (const TRect& aRect )
{
CCamara1* self = CCamara1::NewLC (aRect ); (goes to newLC)
CleanupStack::Pop (self );
return self;
}
CCamara1* CCamara1::NewLC (const TRect& aRect )
{
CCamara1* self = new (ELeave) CCamara1;
CleanupStack::PushL (self );
self->ConstructL (aRect ); (goes to constructL)
return self;
}
void CCamara1::ConstructL (const TRect& aRect )
{
// Create a window for this application view
CreateWindowL ();
iTitleFont = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont);
iAppUi = static_cast<CcamaradecoderAppUi*>(iEikonEnv->EikAppUi());
// Set the windows size
SetRect (aRect ); (here comes the error!)
// Activate the window, which makes it ready to be drawn
ActivateL ();
}
The error says: Thread [Thread id: 1939] (Suspended: Signal 'Exception 0' received. Description: A data abort exception has occurred..) 2 Unknown (0x78D7C378)() 0x78d7c378 1 Unknown (0x78D7C3AA)() 0x78d7c3aa What is it happening? Thanks! |
|
this message is for getting up the post. thanks
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Series 40 5th Edition SDK Includes JSR-211 | Nokia Ron | Mobile Java Tools & SDKs | 9 | 2009-10-03 16:42 |
| Icons in s60 | drizzt6 | Mobile Java General | 5 | 2009-03-06 10:32 |
| Small change required in S60 5th Edition SDK Help and C++ Developer Library | kiran10182 | Developer Resources Feedback (Documentation, Examples, Training) | 3 | 2008-12-15 20:12 |
| stray signal panic in 5th edition on T9 default Fep as well as 3rd party fep. | himsymbian | Symbian User Interface | 1 | 2008-11-21 13:12 |
| Who to start UI development in Series 60 5th edition?? | rohanwaugh | Symbian User Interface | 3 | 2008-11-03 07:14 |