Problem: How to use the Gmail FireDAC Enterprise Connector
Solution tested on C++ Builder 10.2.3
CData is a company with a clever idea. It writes drivers that connect to various technologies and make them appear as if they were databases. Thus, knowing only SQL, you can read a CVS file, use Google’s Gmail, search with Microsoft’s Bing, link in to LinkedIn, and do many other things. CData and Embarcadero have partnered to create wrappers for these drivers in the form of components that you can use in both VCL and FireMonkey programs. Embarcadero calls these Enterprise Connectors. The rest of this post is a demonstration of how to use the Gmail enterprise connector in a VCL program. If you’d rather just see a summary of tips for using the connector, scroll down to the end of this post. If you’d like more background on enterprise connectors, see this post.
Continue reading “Using CData’s Gmail connector in C++ Builder”
Problem: How to use the CSV FireDAC Enterprise Connector
Solution tested on C++ Builder 10.2.2
CData is a company that makes drivers for databases. Although this may sound like a useful but prosaic product, CData has a clever twist. Their mantra is “See the world as a database” and their products take this to heart. They allow you to view many things that aren’t databases as if they were. Examples include accessing sites such as eBay, Instagram, Facebook, Twitter and Gmail; working with programs like QuickBooks, Google Sheets, Microsoft Office 365; and manipulating data that is in generic formats, such as JSON, XML and CSV. The idea is that by using just SQL you can now accomplish a lot more than querying databases. Well, that’s nice, but what does it have to do with Builder?
Continue reading “Using CData’s CSV connector in C++ Builder”
Problem: IDE won’t let you set certain default layouts
Solution tested on RAD Studio 10.2
An IDE desktop layout is a file that records the positions, sizes, contents and visibility of IDE windows. In the RAD Studio main menu bar, selecting View and then Desktops produces a sub-menu of operations related to IDE desktop layouts. One item is Set Debug Desktop, which lets you save the desktop layout that the IDE will use during run-time, i.e., when you’re running a program that you launched from within the IDE. Unfortunately, there are no similar provisions for setting the startup layout or the default layout. Here is how you can do it though.
Continue reading “Setting the default and startup layouts in RAD Studio”
Problem: FMX progress bar won’t update
Solution tested on C++ Builder 10.2
Suppose you’re doing a long calculation that doesn’t involve FireMonkey components. You’d like to update the user with a progress bar. You periodically take a break in the computations to update the progress bar. However, when you run your program, the progress bar doesn’t move.
The solution is to call
Application->ProcessMessages() after updating the progress bar.
Application is a global variable present in all FireMonkey programs. The code below is an example of the problem and its solution. (By the way, this problem also occurs with the animation indicator and other GUI elements such as a label, and you can solve it with the same technique.)
Continue reading “Updating a progress bar during long calculations”