Mark Williams
Members-
Content Count
282 -
Joined
-
Last visited
Community Reputation
14 GoodTechnical Information
-
Delphi-Version
Delphi 10.4 Sydney
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
I've moved to a new laptop running Windows 11. I installed from the downloaded ISO. I'm missing the help files. When I go into Manage Platform (to try and switch off dark mode), I am told that setup cannot continue due to a corrupted installation file. How can I get the help files please and is there a way of fixing the corrupted file?
-
That was ir. Must have inadvertently deleted it. Thanks
-
Just revisited a project after a few days away. Now, for one of the units in the project, when I toggle F12 to show its form, nothing happens. The menu item "Toggle Form/Unit is also disabled. It is only this one form and not any others that has this issue. I am not aware of any changes I may have made last time that could be causing this issue. When I view the project source, I can see that the unit is listed but it doesn't have its form listed after it like all the other project units that have associated forms. I assume that somehow the form's connection to the unit has been lost. Restore in 'Restore.pas' {frmRestore}, Reconciler in 'Reconciler.pas' {frmReconciler}, Settings in 'Settings.pas'; I have tried removing the unit and re-adding it to the project, but that does nothing. Anyone have any idea what might be causing this and how I can fix it? Thanks
-
I have a licence for Delphi 10 through to 11.0. I haven't renewed my subscription since then. I'm trying to move my Delphi to a new laptop. When try and download any version within the above range from Embarcadero I am simply advised that I haven't renewed my subscription and the download is declined. I'm guessing there must be some way of doing this. Can anyone help please?
-
FireDac in memory dataset filter before iterate?
Mark Williams replied to Mark Williams's topic in Databases
Ran some tests on an in memory dataset of 25K records. Without filter 31ms to iterate the whole dataset (whilst also querying each record to see if it matched the required "document_category_id)." . Filtering first took twice as long to filter and iterate even though the resulting dataset was only 30 records. That sort of answers my question. But would this still hold true with say a million plus records? -
I need to work with a potentially large dataset in memory. It has an integer field called "document_category_id". On first loading the table it is sometimes necessary to update records in the table from one document_category_id to another. This might need to be done for several, but not all of the various document_category_ids. Trying to work out what is the most efficient way of iterating. Would it be more efficient to filter on the requored document_category_ids first and then iterate or to iterate on an unfiltered table?
-
Managed to work out a solution in the end. Sure there will be some issues I haven't considered, but seems to work ok. If anyone is interested here's the code: procedure TForm3.TabControl2DrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); var TabName:String; Pt : TPoint; R: TRect; TabUnderMouse:Integer; begin Pt := TabControl2.ScreenToClient(Mouse.CursorPos); TabUnderMouse := TabControl1.IndexOfTabAt(Pt.X, Pt.Y); with (Control as TTabControl).canvas do begin R := Rect; if TabIndex=1 then Font.Style := [fsStrikeout]; if (TabUnderMouse = TabIndex)and Active then Font.Color := TStyleManager.ActiveStyle.GetStyleFontColor(sfTabTextActiveHot) else if Active then Font.Color := TStyleManager.ActiveStyle.GetStyleFontColor(sfTabTextActiveNormal) else if (TabUnderMouse = TabIndex) then Font.Color := TStyleManager.ActiveStyle.GetStyleFontColor(sfTabTextInActiveHot) else Font.Color := TStyleManager.ActiveStyle.GetStyleFontColor(sfTabTextInActiveNormal); tabName := TTabControl(Control).Tabs[TabIndex]; Brush.Style := bsClear; DrawText(Handle, PChar(TabName), Length(TabName), R, DT_SINGLELINE or DT_VCENTER or DT_CENTER) end; end;
-
I want to show a TabControl with tabs with different font styles. Basically, I want the font in some of the tabs to be shown in strikeout. The app uses a couple of different themes. I thought I'd use the StyleManager to achieve this with the following code: with (Control as TTabControl) do begin tabName := TTabControl(Control).Tabs[TabIndex]; if TabIndex=1 then Canvas.Font.Style:=[fsStrikeout]; Pt := TabControl2.ScreenToClient(Mouse.CursorPos); TabUnderMouse := TabControl1.IndexOfTabAt(Pt.X, Pt.Y); if Active then Details := TStyleManager.ActiveStyle.GetElementDetails(ttTabItemSelected) else if (TabUnderMouse=TabIndex) then Details := TStyleManager.ActiveStyle.GetElementDetails(ttTabItemHot) else Details := TStyleManager.ActiveStyle.GetElementDetails(ttTabItemNormal); TStyleManager.ActiveStyle.DrawElement(Canvas.Handle, Details, Rect); TStyleManager.ActiveStyle.DrawText(Canvas.Handle, Details, TabName, Rect, DT_VCENTER or DT_CENTER, Canvas.Font.Color); end; This sets the colour of the tab background perfectly depending on its state, but has no impact on the font which is always black. However, the font is always black whatever the state of the tab. The color parameter in the DrawText function does not appear to do anything. I've tried setting the canvas font color before calling Drawtext to the stylefontcolor of the tab element in its various states. It has no effect, not does entering any color whatsoever in the color parameter.
-
Thinfinity VirtualUI - cloud-based conversion
Mark Williams replied to Mark Williams's topic in General Help
Seems to be spam. -
Thinfinity VirtualUI - cloud-based conversion
Mark Williams replied to Mark Williams's topic in General Help
I've used it on one smallish app so far. It works perfectly with just one line of code. You may need to tweak a few things if you want to open documents, but it is very straightforward. It took a little bit of time to get my server set up correctly and I needed support from Thinfinity to do this, but the support was superb. -
TStringStream inconsistent results
Mark Williams replied to Mark Williams's topic in RTL and Delphi Object Pascal
That seems to be the answer. Many thanks. I think I initially went with LoadXMLData because it created the XMLDocument for you in the same step. A false economy it seems! -
I have an ISAPI DLL written in Delphi 10.4 running on my server. I exchange information in XML format with the DLL via an app also written in Delphi 10.4. Both the server and the user computer are using Microsoft XML 6.0. I use the following function to convert the exchange xml streams to a string and then to load into IXMLDocument. Function ConvertStreamToString(stream:TMemoryStream):String; Var ss:TStringStream; begin if (Stream <> nil) and (stream.Size>0) then begin Stream.Position:=0; ss:=TStringStream.Create; try ss.CopyFrom(stream, 0); Result:=ss.DataString; finally ss.Free; end; end else Result := ''; end; I load the xml data with: Doc := LoadXMLData(ConvertStreamToString(Response)); This works fine for data received from the server, but not for data submitted to the server. The data is received complete by the server (I save the received stream data to file to test), but something goes wrong with the convertStreamToString function and the LoadXMLData function throws up an error: If I change the stream conversion function to: SetString(Result, PChar(Stream.Memory), Stream.Size div SizeOf(Char)); This works for the DLL on the server, but fails on the local app. It returns a load of junk throwing up an AV on the call to LoadXMLData. I could have a different functions for the server and the local app, but I would rather have some idea as to why this is happening. I guess it is to do with encoding, but can anyone give me a steer as to how I resolve it please?
-
FireDac Array DML Update query - omitting certain fields
Mark Williams replied to Mark Williams's topic in Databases
Yes. As I explained that would work, but I would have to submit a mass of additional data to my server that is unnecessary if you use COALESCE. No. Trying to write it as flexible as poss -
FireDac Array DML Update query - omitting certain fields
Mark Williams replied to Mark Williams's topic in Databases
You're a genius. I'm an idiot. Why didn't I think of COALESCE. Thanks -
FireDac Array DML Update query - omitting certain fields
Mark Williams replied to Mark Williams's topic in Databases
Possible, but I'm posting data to a server which then submits the query and it could be an awful lot of unnecessary data to post.