-
Content Count
67 -
Joined
-
Last visited
Everything posted by Tom Chamberlain
-
Autorun from USB is turned off by default on Windows 10 and 11 now.
-
This is how it is suppose to work (for FireDac and ADO), you create a blob for the database engine TFDBlobStream, giving it the DB field with write access, then save into that blob stream. (yes free the blob before the post) I'm using rich text here with embedded fonts and graphics so a PNG is not any different. var BlobStream: TFDBlobStream; .... dbQueryObj.Append; .... BlobStream := TFDBlobStream.Create(dbQueryObj.FieldByName('Notes') as TBlobField, bmWrite); try rveEditor.SaveRTFToStream(BlobStream, False); finally BlobStream.Free; end; dbQueryObj.Post;
-
sending text between applications (10)
Tom Chamberlain replied to jbWishmaster's topic in ICS - Internet Component Suite
Another option if you have Delphi Enterprise would be DataSnap so you don't have to deal with TCP/UDP level stuff directly. We have a DataSnap service running on a server that all the clients talk to (they know the servers IP). We send this service the User ID, IP address and other information via an object (DataSnap does all the marshalling) and the service tracks the initial connection time and last seen time. We store this object in an object list in memory in the DataSnap service. When the clients connect to this service the DataSnap TDSTunnelSession gives us the unique client and session id's, we then use the DataSnap DSClientCallbackChannelManager.RegisterCallback method to register a callback method to the client with the server. Now the server knows the IP address and can make a callback to any/all the connected clients passing a TJSONValue so you can pass anything you want and again DataSnap does all the marshalling. We have built our own messaging/command structure using this TJSONValue and calling methods in the DataSnap service to send messages. The server then loops thru the list of clients and sends the message to the client(s) via the registered callback. We can request the client(s) 'Check-In' to is if they are still there, get a list of other/all connected clients, send messages that pop the Windows tray notification and we can even force a termination of the client(s) if needed thru an admin client. We have even enabled authentication, compression and encryption of all this communication with just a few DataSnap properties. This does put all the work on the server and the clients cannot work/send messages without the server so this will not work if you want direct client to client communications. We built this years ago and it works well for us, but you could build the same type of thing with MQTT, that was our other option. DataSnap just gave us a few more options/control we were looking for at the time even if there is some DataSnap overhead and a learning curve. It was also something we already owned and we would not need to include another piece of open source in our software and knew would continue to work and be updated with future versions of Delphi. (we hope) -
Delphi 11.1 - IDE - some objects on form 'move or resize' when form saved
Tom Chamberlain replied to rudy999's topic in Delphi IDE and APIs
This is all High-DPI related issues, if I start the IDE in DPI unaware mode I don't have this problem. -
Delphi 11.1 - IDE - some objects on form 'move or resize' when form saved
Tom Chamberlain replied to rudy999's topic in Delphi IDE and APIs
I have had the same issue but with none visual controls like data sources and report builder components, but it is only on some projects. I assume it is a high-dpi issue of some kind or some project setting somewhere. -
Application.CreateForm : Shows Main form before Application.run
Tom Chamberlain replied to gioma's topic in VCL
It has been many years since implementing the method we use now but I remember there being some memory leaks or issues if we never let 'Application.Run' fire. I think it had something to do with possible objects being created in the TfrmMainForm's on create and if you never call 'Application.Run' it never called free on the form or something strange like that. We may have done it this way just to be safe and make sure things got cleaned up under every circumstance. But it looks like the issues was thread related anyway, not related to when the main form was set to visible. -
Application.CreateForm : Shows Main form before Application.run
Tom Chamberlain replied to gioma's topic in VCL
Did you try it this way: Application.Initialize; Application.Title := GF_GetAppName; Application.MainFormOnTaskbar := True; Application.ShowMainForm := False; Application.CreateForm(TPrimaryForm, PrimaryForm); if NOT (pos('-NOSHOW', UpperCase(CmdLine)) > 0) then Application.ShowMainForm := True; Application.Run; We have a class we inherit from TForm that we use to display our splash screen for EXE's and to prompt for user login, the only difference is we terminate the app if they can't pass the login. This way the frmMainForm.Show is not called with Application.CreateForm but it is when the Application.Run is called. -
Maybe something to do with Marco's blog post from January 3rd, here.
-
Showing a warning form to some users
Tom Chamberlain replied to Henry Olive's topic in RTL and Delphi Object Pascal
Agreed, we use a simple DataSnap service for something like this so no 3rd party things are needed as long as you have the enterprise or better version. Create a DataSnap process to run as a Windows service or Linux daemon to be the controller Clients starts and registers itself with the DataSnap service with a call back event so the service can talk back to the client The process that post to the dispatch table also connects to the DataSnap service but to only send a message to the DataSnap service that the record was posted The DataSnap service then sends a message to all or individual clients via the call back This call back is a JSON value so you can pass back whatever you want/need to the client, we pass back 'commands' with multiple other values. After you get it functioning you can add security and encryption if needed. Check here (it was not working for me) and here for some help. -
Microsoft Remote Desktop Services RemoteApp does this, so does VMware ThinApp Virtual Applications. This has nothing to do with Delphi and would probably break some Microsoft license somewhere.
-
We only install the IDE (+ 3rd party components/tools) and leave the source folders and source control on the host, build DCU/EXE/DLL's to the host share the so other VM's (2019 and Ubuntu) can access them. For dot update 10.2.1 -> 10.2.2 just a simple backup copy of the VM before the upgrade. We try to skip releases so 10.2 -> 10.4 was a clean VM and fresh install of the IDE, all mapped to the same source share on the host.
-
Transforming Data (Pivot ?)
Tom Chamberlain replied to david_navigator's topic in Algorithms, Data Structures and Class Design
Create/load a TClientDataSet (or TFDMemTable) on the fly every time the user picks a different DataSet by reading the distinct Settings values within the DataSet and creating columns for each Setting (replace spaces with underscores or something) and if you know the data type of the Setting even better. Then load the data by reading the DataSet and dropping the data into the correct column by the Setting name, when the Instance changes start a new record in the TClientDataSet, repeat. Then you can display the data any way you would like. You could do the same thing with a couple of dynamic arrays, one to hold the columns and another to hold the data if you don't need to know the data type in each column. -
Help to create a Query and Display the results in a dbGrid
Tom Chamberlain replied to Mikheil's topic in Databases
A simple direct answer: (use of a DataModule and Like are optional and up to you) Drop a new TQuery on the form or datamodule. Drop a TDataSource on the form or datamodule, set the DataSet property of the TDataSource to the new TQuery. Drop a TDBGrid on the form, set the DataSource property of the TDBGrid to the TDataSource. Use a sample SQL statement in the TQuery and activate the TQuery, you should get data in your grid at design time. Right-click the TDBGrid and select Columns Editor. Right-click inside the columns editor property window and select Add all fields to populate the fields in the grid. You can delete the columns you don't want to display in the grid, change the order and you can set the column heading in the Title property. Now this is a quick and easy answer that I would try to avoid myself if possible, there are issues with doing this if you have blob fields or large amounts of data. I would never let the users edit the data this way! If you have access to some other data-ware components besides the base TDBGrid like TMS, Woll2Woll, Steema or Devart you can get a lot more features/functions out of one of those grids. Hand loading a string grid is also a good option if you don't want a data-ware grid, this would be my option. -
I have a set of custom templates that I have used for years, just moved them from version to version, they are simple: fbnc = FieldByName('FieldName').AsCurrency fbni = FieldByName('FieldName').AsInteger ... In 10.3.3 I could do dbSomeQuery.fbnc followed by a CTRL+Space and just press Enter for code completion and position to the highlighted FieldName in the template, in 10.4.2 this does not work. I did not try this in 10.4 or 10.4.1, I was waiting for update #2 😞 If I do a fbnc on a line by itself and hit TAB it works so it is seeing the template, it is like it does like the . before the template name or maybe it does not like being on a line with other code. I have tried changing the delay on the Options -> User Interface -> Editor -> Language (Delphi) -> Code Insight tab, I also tried the Auto Invoke option. Does anyone have a hint on how to make this work in 10.4.2 or is this a new 'feature'?
-
Delphi 10.4.2 custom templates
Tom Chamberlain replied to Tom Chamberlain's topic in Delphi IDE and APIs
Yes it is...so I wait. -
To late for me also, web installer, killed off the Linux and Windows 64bit paths...have a backup to copy from.
-
Performance issues running Delphi Applications on Windows VM
Tom Chamberlain replied to costa's topic in Tips / Blogs / Tutorials / Videos
Doesn't FMX use DirectX or OpenGL to draw the screen? (I to have no experience with it) VMware ESXi is not the same type of hypervisor as Parallels, VMware Player or VirtualBox but VMware tools must be installed no matter what. A basic ESXi VM's video memory is limited and not indented for graphic intense processes without adding a special 3D hardware card (NVIDIA GRID/AMD Multiuser) to the server. There are 3D software options at a VM level but that can be a CPU hog and depending on the resources allocated to the VM or the Resource Pool the VM is configure in there are other limits put on the performance of a VM like the total workload of the server. Connecting with RDP won't help with this problem, if you have VMware Horizons you may be able to use the VM and Horizons pool 3D software features along with a Horizon Client software or zero thin client with PCoIP or Blast to maybe run better. -
That tutorial is using SQL Lite as an embedded database and is a little different from using something like M$ SQL Server or MySQL where there is another service/process running that you are talking to. That service could be on your computer or on a server were multiple users are talking to it at the same time over a network. You can write SQL commands against them all, but the features and syntax for some functionally changes from database to database and some are not even available. If you want to use SQL Lite you do not need MySQL or M$ SQL Server, you can do everything with FireDAC. I have never used SQL Lite with FireDAC personally. (sometimes I miss the BDE and dbase days, I think I just aged myself) Check this comparison for a sample of just three of the free database out there: https://www.digitalocean.com/community/tutorials/sqlite-vs-mysql-vs-postgresql-a-comparison-of-relational-database-management-systems Also check out: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_SQLite_with_FireDAC
-
And it runs on Windows, Linux and Mac. With a little editing of the vbox file (Virtualbox Machine Definition) you can move/copy your VM's from one platform to another.
-
Why should I use good source control versioning system?
Tom Chamberlain replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
There are only two of us now but for years it was just me and I have used SVN for many, many years. Now we do all development in VM's (VirtualBox) and leave the source on the host and access it via virtual share/drive letters, never on the VM's. Source control is good old SVN with TortoiseSVN, all commits/update done from the host. We have an in-house SVN server with repositories for each projects, This makes upgrading version of Delphi simple, we build new VM's for new version of Delphi so we never have cross version compile/component install issues, because that never happens 😮 and use cloned repos for testing new version in new VM's before we ever move production code to a new Delphi version. -
I received an AV during the installation (twice) and have reported it https://quality.embarcadero.com/browse/RSP-29158 The third attempt (after a restore) worked fine, see my comments in the report.
-
How to connect from remote program to Datasnap serwer located in local network
Tom Chamberlain replied to Andrzej Miechowicz's topic in Network, Cloud and Web
Never directly expose a database server of any kind to the internet, you are just asking for trouble. Like Hans said a REST service would be better but a VPN connection would be best. You may be able to do a DataSnap server on the local network and make request to it from the outside and have it talk to the FireBird server but you should look at doing it through IIS or Apache and using an SSL certificate to protect your data. Are you using some type of encryption or SSL cert when talking with the Andriod app? -
How to connect from remote program to Datasnap serwer located in local network
Tom Chamberlain replied to Andrzej Miechowicz's topic in Network, Cloud and Web
What type of Datasnap server did you make? Standalone EXE (GUI), Windows Service, IIS DLL or Apache module? If it's an IIS DLL or Apache module, then yes you will need the matching IIS or Apache server installed. Is it a EXE or Windows Service, then it run it or install the service and start it. What are you wanting to do with it, simple remote dataset access, remote method calls, passing objects, register and call backs or what? Have you tried the demos and http://docwiki.embarcadero.com/RADStudio/Rio/en/Tutorial:_Using_a_DataSnap_Server_with_an_Application is a good starting point. -
Do you have the PAServer (Platform Assistant) installed on a Linux machine you have access to? The Linux SDK is not included, you have to make a connection to a linux machine via the Options -> Deployment -> Connection Profile Manager or SDK Manager so that the correct includes can be pulled from the linux machine. Use Ubuntu to start with, it is the simplest to get going, here is a video on how to set this up.
-
Did you install FMXLinux from GetIt? If not you have to install it first, then right-click on the project (Project1.exe) to get 'Add Linux Platform'