Delphi - TCameraComponent won't find flash - delphi

I'm using Delphi 10.0 Seattle and trying to use the rear cameras's light on a Lenovo Thinkpad tablet running Windows 10 Pro. I am using TCameraComponent.
I tried using CameraComponent.TorchMode := TTorchMode.ModeOn from FMX.Media, but it raises an exception saying that the device has no torch.
Anyone know why this happens, and if there is some way to access this light/flash?

FMX in Delphi 10.0 Seattle does not implement either Flash or Torch functionality at all on Windows. It is only implemented on OSX, iOS, and Android.
You will have to resort to using Windows-specific APIs, or even manufacturer-specific APIs, to access light/torch functionality. For example, there are FlashControl and TorchControl classes in the Windows UWP API.

Related

Adapting existing win usb driver for LabVIEW

I have a specific USB device that has it's own driver for Win7.
It works fine in my .NET application, I'm using drivers functions (C++) to manipulate device.
Now I'm trying to get this device work in LabVIEW.
Is there a way to somehow adapt existing driver for it? Or it is useless and I need to write completely new driver for LabVIEW?
For now I created a driver using "NI-VISA Driver Wizard" so that "NI MAX" and "NI-VISA Interactive Control" detect my device. But I don't know what to do next?
Compile the driver C source files as a dll.
https://forums.ni.com/t5/Measurement-Studio-for-VC/How-to-create-a-DLL-file-from-a-C-file/td-p/866863
Then import the dll into LabVIEW.
http://digital.ni.com/public.nsf/allkb/DCB90714981A1F148625731E00797C33
As highlighted by Prain, the following is an example describing how C/ dll can be used in LabVIEW
https://forums.ni.com/t5/Example-Program-Drafts/Using-Existing-C-Code-or-a-DLL-in-LabVIEW/ta-p/3499233

Delphi XE7 Application on Galaxy P5200

I downloaded the trial version of Delphi XE7.
After successfully compiling and running some demos on a a virtual device, I connected a Galaxy Tab 3 P5200 through the USB cable.
When I compile and run an application, it is correctly deployed to the device, but when it starts a black screen appears with the following message:
Application does not support this device
In the Delphi XE7 datasheet there is a small box with the "Supported Deployment Platforms" ... for Android they say that an ARMv7 device with NEON support is required. The Galaxy 3 P5200 has an Intel Atom CPU Z2560 ... so Delphi XE7 simply cannot build applications for this device ...
I don't know if you still have this problem but I'll answer it anyways since this problem might occur to other people as it happened with me.
I was able to solve this issue following this:
Running Delphi Applications on Android Intel
From what I could understand, Firemonkey tries to inject code into the application as a some sort of test, and by doing so it uses both mips and x86 architecture, and those are not supported by Intel Atom processors...
Galaxy Tab 3 uses an Intel processor, so I'm sure this will work for you.
In the IDE, open the Deployment Manager (Project > Deployment), and locate the following entry:
After doing so, clean and re-build your project, the application should work just fine.
You can read more about it on Embarcadero's Wiki.

Windows 8 Message Window

Windows 8 has a new message window that displays in the top right side of the screen. Does Delphi XE4 have any API to access this new feature?
This kind of dialog is part of the Windows.UI.Notifications namespace which belongs to the WinRT, and unfortunately you cannot access the WinRT from Delphi directly. but maybe you can try this article to check a sample with experimental access to the WinRT from Delphi, Writing Hello World for WinRT in Delphi
This is Notifications or Toasts, you can find a C++ and C# example here - http://code.msdn.microsoft.com/windowsdesktop/Sending-toast-notifications-71e230a2
I've yet to see a direct Delphi implementation of this which is why I can only suggest the C++/C# version.

Delphi XE2 Firemonkey iOS app controls compatibility

As you all know, Embarcadero just released Delphi XE2. I have download it and i am very excited about having an way of creating an iOS app.
To create the iOS app we should export the code to xcode. But the question is: does every control works on iOS/xcode? I mean, if i want to connect to a sql lite database can I use the delphi controls to do so?
Is there any way of accessing some specific things in iOS like acelerometer and camera?
Is it possible to create a useful iPhone/Ipad app in Delphi (connect to a database, load grids, connect to a webservice, for example)?
1- I don't think you can Components Not Used in iOS Applications
-- I think you can use the TDatasource and the TClientDataSet though ;-)
2- Delphi uses FPC compiler for the iOS so you'll have to parse the iOS SDK headers before you can use it Parsing iOS headers or http://wiki.freepascal.org/objectivepascal#iOS_Headers but there are no out-of-the-box components (yet) that can access the Camera, Accelerometer, ...
3- Check number 1.
Actually ... I think TClientDataSet isn't supported on iOS. I could be wrong ... but at least it wasn't supported a few months ago.

Supporting Delphi 7 apps in D2006 / D2009

I started occupational programming with Delphi when the Turbos came out , and have licenses for Delphi 2006 Turbo Pro and Delphi 2009 Professional. I have been asked to support another in-house tool, written by another occupational programmer, who has since retired.
It's a Windows program, but it was developed with Delphi 6 using the CLX library rather than the VCL.
From what I gather, the CLX library was QT based and was removed prior to Delphi 2006.The support only consists of a few bug fixes and some minor tweaks, so I would rather not port the code to VCL, if i can avoid it.
Is it possible to install CLX support into either Delphi 2006 or 2009?
Maybe not a direct answer but if you upgrade to Delphi XE, you will also get license keys for some of the older versions of Delphi down to 7, and Delphi 7 included CLX (it was dropped in Borland Delphi 2006).
The short answer is: no. Unfortunately I don't know any long answer which could tell you how to workaround this.
No, you can't add support for CLX to your other Delphi versions.
If it's in-house software, then your company should still have the in-house Delphi installation used to develop it. Multiple Delphi versions can co-exist on the same system; install earlier versions before installing later versions.
If the former employee took that installation with him when he left, can you get it back? I wouldn't expect it really belongs to him anyway. You said he retired; that wasn't a euphemism for died, was it? If not, then you can still contact him.
If there isn't an easy way (and I suspect that there is not), you may need to continue using D7. D2009 is going to introduce the hassle of Unicode, and even going to D2006 is going to cause problems with 3rd-party libraries.
You could run both versions of Delphi on the same machine, but another option would be to use a VM for the legacy development. Either set up a new instance, or you could use the VMWare Converter to convert the other developer's entire machine into a VM image, which you could run on your machine, via the free VMWare Player.
BTW, VMWare Converter is a GREAT way to preserve old environments, to allow maintenance on older software that really needs to use a particular Delphi version, on a particular OS, "just like I left it". If you have a bunch of dusty computers under your desk, consider this option. VMWare Converter is the only tool I know of that will easily convert a physical machine to a useable VM that will run anywhere.

Resources