Solved

FMX TCameraComponent Problem

Posted on 2016-11-28
2
50 Views
Last Modified: 2016-11-30
I am using the Embarcadero Demo program for the FMX TCameraComponent control which is targeted on an Android device (Samsung T700 Tablet).
I am using Embarcadero C++ Builder XE 10.1 Berlin, Update 2, Enterprise edition.
I have added an extra line of code in the button-click event handler which activates the camera but a compiler error is generated at his line of code as shown below.
How do I set the camera to auto-focus ?
Code:
void __fastcall TCameraComponentForm::btnStartCameraClick(TObject *Sender)
{
      // Turn on the Camera
      CameraComponent->Active = True;
      CameraComponent->FocusMode = ContinuousAutoFocus;// <--- new line of code added here
      tbControl->TabIndex = 1;
}
Error message:
[bccaarm Warning] uMain.cpp(92): 6 enumeration values not handled in switch: 'FinishedLaunching', 'BecameActive', 'WillBecomeForeground'...
0
Comment
Question by:alcindor
2 Comments
 
LVL 8

Accepted Solution

by:
Subrat (C++ windows/Linux) earned 500 total points
ID: 41906266
I feel it is a warning not error.
You have not handled all the possible enum values in your switch case and might be not default case written.

If possible, Can you copy past some of the lines from 90 to 100 of uMain.cpp
Want to see line 92 statement.
0
 
LVL 2

Author Comment

by:alcindor
ID: 41908029
You are correct, There was also an error message but I mistakenly picked up on the warning message. I corrected the cause of the error message (elsewhere) and the warning persisted but the code ran without any error. I subsequently added a default case in the switch statement which handled the previously un-handled values.

Thanks for your help,

Roger

      switch (AAppEvent) { // line #92
            case TApplicationEvent::WillBecomeInactive:
            case TApplicationEvent::EnteredBackground:
            case TApplicationEvent::WillTerminate:
                  CameraComponent->Active = false;
                  return true;
                  break;
            default: //  added to remove warning
                break;
      }
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VMWARE 5.5 1 73
How to gracefully close the c++ 11 thread? 3 83
Upgrading my processor 5 69
Embarcadero WebBroker REST server endpoint parameters 2 54
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now