chkaufmann
Members-
Content Count
158 -
Joined
-
Last visited
Everything posted by chkaufmann
-
Hi, I try to create this helper: TComponentHelper = class helper for TComponent public function FindComponents<I:IInterface>: IBSEnumerable<I>; overload; function FindComponents<T:class>: IBSEnumerable<T>; overload; end; but I get an error "methods with identical parameters". In my generic code I filter components either by using "InheritsFrom" or "Supports()". Therefore I need IInterface and class in the declaration or is there another way to do that? Christian
-
Thanks Remy, perfect solution. Christian
-
But if I don't declare T:class I cannot use it in the InheritsFrom() method. Same for an IInterface with the Support method: function TComponentHelper.FindComponents<I:IInterface>: IBSEnumerable<I>; var ix : Integer; lst : IBSList<I>; tmp : I; begin lst := TBSGenerics.GenList<I>; for ix := 0 to ComponentCount - 1 do if Supports(Components[ix], I, tmp) then lst.Add(tmp); Result := tmp; end; function TComponentHelper.FindComponents<T:class>: IBSEnumerable<T>; var ix : Integer; lst : IBSList<T>; tmp : T; begin Assert(T.InheritsFrom(TComponent), 'Nur für Subklassen von TComponent'); lst := TBSGenerics.GenList<T>; for ix := 0 to ComponentCount - 1 do if Components[ix].InheritsFrom(T) then begin TComponent(tmp) := Components[ix]; lst.Add(tmp); end; Result := lst; end; Christian
-
Thanks for all hints. I already use FastMM full version, so I know, there are no memory leaks. I run a huge import from one database to another. I have to pass the data through my business classes. Since I use interfaced objects a lot, destruction is sometimes late. Combined with caching of some complex structures it's not always obvious, where there are still references. I will try to add logging with the code of Stefan. Christian
-
Hi, when I change the color and/or style (italic, underline) of the Font of any control (most of the time it's TLabel), then I get this in the DFM: Font.Charset = DEFAULT_CHARSET Font.Color = clHighlight Font.Height = -12 Font.Name = 'Segoe UI' Font.Style = [fsBold] ParentFont = False But the added information is only this: Font.Color = clHighlight Font.Style = [fsBold] Now the only solution I see, is to write my own descendant for the control and add my own properties for Style and Color. But even then I would have to suppress usage of these properties during design time in order to leave Font/ParentFont unchanged. Or did I miss something? Christian
-
The goal is, to avoid values for unchanged properties (Name, CharSet, Height) spread over all my controls in the DFM files. If I want my application using the Screen.MessageFont, automatic update does not work for all controls with different color and/or style. Christian
-
I have a custom control and defined the following published properties: property MaxValue: Integer read FMaxValue write SetMaxValue default High(Integer); property MinValue: Integer read FMinValue write SetMinValue default Low(Integer); It works fine for MaxValue, but for MinValue I always get this in my dfm files: MinValue = -2147483648 Are there limitations for default values and if yes, where can I find these? Christian
-
Thanks for the solution. Christian
-
I except the default not to be written to the DFM at all. It works for High(Integer) but it looks like it doesn't for Low(Integer). Christian
-
Thanks for your answer. You are right regarding "properly" designed forms. Unfortunately I deal with old applications, that are not perfect and I thought, if I see it with the most common font/size used today, I could just fix the major problems. Mainly fix "Top" and "Height" problem are an issue because all labels and controls are higher. Christian
-
I looked at the problem again and this seems the most reasonable solution for me. The only question that remains, how can I set the IDE font used during designing to "Segoe UI, 9pt" because right now, when I choose "ParentFont = True" then I still get "Tahoma 8pt". Christian
-
I handle all requests in OnCommandGet. Sometimes these get blocked but I couldn't locate yet where and why. As a first solution I would like to cancel the command after a certain time. I found the TerminateWaitTime property, but since the value is never used in code I think this doesn't work. Is there another solution for this? Something like max_execution_time in PHP? Christian
-
TIdHTTPServer.OnCommandGet - Timeout
chkaufmann replied to chkaufmann's topic in Network, Cloud and Web
Follow up question: I create my own request object in my OnCommandGet event. Is there a way to have a reference to this in the current TIdContext or do I have to build my own list/container for this? Christian -
TIdHTTPServer.OnCommandGet - Timeout
chkaufmann replied to chkaufmann's topic in Network, Cloud and Web
I still try to locate the problem. Right now I have the situation, that a request blocks all following request. So I want to cancel it as save as possible. In the main thread I know my TIdHTTPServer component and I know the TIdContext of the request I want to remove. What is the savest way to do it from "outside the request"? -
I have a strange problem, not sure if it is because of Win10 or Delphi Rio 10.3.2. For some users my application gets blocked completely when not used for some time and when there are other applications running on that computer. Now I found out, that my application has a green leaf symbol in the task manager with the hint "UWP process group is suspending". Now I don't find a clear answer but it looks like my application is sent to a suspended mode by Windows in some cases. - How can I avoid that? - Are there any Windows messages I have to handle so I can ensure my application is not blocking? Christian
-
Hi, I use a TIdFtp component to upload files to a server in a background thread. The main application creates changed file irregularly, sometimes there is up to 30 minutes between two uploads, sometimes there are up to a 100 files at the same time. My problem is that a some point the server disconnects and calling IdFtp.Put() fails. Is there no message from the server when it disconnects? Can a get this information from the server somehow? Or what is the best way to handle that? My first approach was doing Connect/Put/Disconnect for each file but I have one user who has a problem with his web provider because of this - when uploading too many files at the same time. Christian
-
In the end, that's what I was afraid of 😞. Any hints on how to isolate that? Especially on a users computer since I never had it on my own machine. The number of places something wrong happens are almost endless in a huge application. All I know is, often when it happens, the computer comes back from screen saver mode. Christian
-
Hi, I wrote a remote storage for files and manage it using an Indy TIdHttp component with some post request (get file, put file, delete file). So far this works fine local and with a remote server but when I try the script with my hosting provider I get a "Connection reset by peer" for some requests. I can reproduce it when I try to put a specific file. I always use a TIdMultiPartFormDataStream with some text variables and a file upload. I always get an error 5000 and an empty response in this case and the error message "Connection reset by peer". I already had some emails with my provider and the ensure, that there is no firewall or anything blocking my requests. And now comes the most difficult part: I tried to reduce my main application to a small sample application just with this specific request and now the request runs fine, file is uploaded and saved. So as next I put the test request in the MainForm.FormCreate event and it works as well, even when I call it more than once. I always recreate my TIdHttp component but the question remains, why do I get this error? And what could I do to isolate the problem? Christian
-
Thanks for the link, but my questions remain since I cannot tell the user to buy a faster computer and/or not to run any other applications. Somebody writes "Only Apps will be suspended." So my question is, why my application is considered as an app? I didn't find any flag in the project settings for this. I compiled it as regular VCL Win32 application. And when my application is suspended, why is it blocked and not activated again automatically? Somehow it looks like the message queue is not handled anymore. Christian
-
Hi, since using Rio 2 in some cases when the IDE starts to compile in background it blocks for a few seconds and then the IDE stops and disapears without any further notice. Most of the time it happens when I'm typing new code which obviously is not valid. I would like to turn off this background work as good as possible. I don't need error insight. Sometimes I need Ctrl-Space for identifier completion but I could live with a list of identifiers that were there when I hit F9 the last time. What is the list of options I have to turn off? Christian
-
Hi, I have a component with a string property that contains extra information. Instead of a simple text it can be a memo with many lines. What is the easiest way to have this property opened in a memo editor instead of a simple single line edit? Do I have to create my own property editor or is there a default one I can define for it? Christian
-
Sure! It's an old component I wrote ten years ago and don't ask me why I created a String property in the first place. I changed it and all works fine now. Christian
-
In "Tokyo" there was a different icon on the tab when a source file was modified. In Rio I see no icon or marker for "modified" on the tab. I checked my settings "Show image on tabs" is selected. Are there any other settings I have to look for? Christian
-
Thanks. The colored bar is better than nothing. I hope the icons will come back in some update. Maybe I'm getting old, but today I try to avoid too many different 3rd party stuff where ever possible. Christian
-
Hi, I have a project group with four applications. Since I switched to Rio, using F9 or Ctrl-F9 sometimes goes wrong. "Logo12" is my active project but it compiles not only this one but one of the others as well. Here is my .grouproj file. I don't see anything, that could cause the problem: <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <ProjectGuid>{BAB4E504-1645-40A4-8EFD-7B3797E49F2A}</ProjectGuid> </PropertyGroup> <ItemGroup> <Projects Include="Logo12.dproj"> <Dependencies/> </Projects> <Projects Include="Logo12Tests.dproj"> <Dependencies/> </Projects> <Projects Include="Logo12Kuba.dproj"> <Dependencies/> </Projects> <Projects Include="Logo12KubaDe.dproj"> <Dependencies/> </Projects> </ItemGroup> <ProjectExtensions> <Borland.Personality>Default.Personality.12</Borland.Personality> <Borland.ProjectType/> <BorlandProject> <Default.Personality/> </BorlandProject> </ProjectExtensions> <Target Name="Logo12"> <MSBuild Projects="Logo12.dproj"/> </Target> <Target Name="Logo12:Clean"> <MSBuild Projects="Logo12.dproj" Targets="Clean"/> </Target> <Target Name="Logo12:Make"> <MSBuild Projects="Logo12.dproj" Targets="Make"/> </Target> <Target Name="Logo12Tests"> <MSBuild Projects="Logo12Tests.dproj"/> </Target> <Target Name="Logo12Tests:Clean"> <MSBuild Projects="Logo12Tests.dproj" Targets="Clean"/> </Target> <Target Name="Logo12Tests:Make"> <MSBuild Projects="Logo12Tests.dproj" Targets="Make"/> </Target> <Target Name="Logo12Kuba"> <MSBuild Projects="Logo12Kuba.dproj"/> </Target> <Target Name="Logo12Kuba:Clean"> <MSBuild Projects="Logo12Kuba.dproj" Targets="Clean"/> </Target> <Target Name="Logo12Kuba:Make"> <MSBuild Projects="Logo12Kuba.dproj" Targets="Make"/> </Target> <Target Name="Logo12KubaDe"> <MSBuild Projects="Logo12KubaDe.dproj"/> </Target> <Target Name="Logo12KubaDe:Clean"> <MSBuild Projects="Logo12KubaDe.dproj" Targets="Clean"/> </Target> <Target Name="Logo12KubaDe:Make"> <MSBuild Projects="Logo12KubaDe.dproj" Targets="Make"/> </Target> <Target Name="Build"> <CallTarget Targets="Logo12;Logo12Tests;Logo12Kuba;Logo12KubaDe"/> </Target> <Target Name="Clean"> <CallTarget Targets="Logo12:Clean;Logo12Tests:Clean;Logo12Kuba:Clean;Logo12KubaDe:Clean"/> </Target> <Target Name="Make"> <CallTarget Targets="Logo12:Make;Logo12Tests:Make;Logo12Kuba:Make;Logo12KubaDe:Make"/> </Target> <Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/> </Project> Any hints or tips what goes wrong? Christian