-
Content Count
1167 -
Joined
-
Last visited
-
Days Won
16
Everything posted by FPiette
-
Installation of fresh Delphi 11.2 fails: Exception in module rtl280.bpl
FPiette replied to Hans♫'s topic in General Help
I would suggest to install basic Delphi for Windows, without any additional platform. Then when successful (Create an hello world type FMX application to check) add other platforms. It is likely that Delphi 11.2 use newer platform SDK compared to 10.4. Not sure you don't have to remove the existing SDK before installing it again thru Delphi installer. -
What I meant is that it is not the best way to use ICS. What Angus suggested is a good idea. Have your pool of ICS components run asynchronously in a single thread dedicated to that. And from the session thread, call the pool thread to execute the HTTP requests. Use thread synchronization object to make sure no conflict with concurrent access from all session threads. You can use ThreadAttach and thread detach if you like but you must be sure to attache before socket is opened and before any communication take place and detach after all communication is done and socket closed. I'm not sure about OpenSSL work when used from several threads.
-
This article explain how to use a font without installing it. This is not Delphi but make almost only use of Windows API which you can use from Delphi. Once the font is loaded, you can use it to paint individual characters to bitmaps and add them to TImageList.
-
Why in the first place do you create a thread? Is this a DelphiMVCframework requirement? Of course you can put your TSslHttpCli component in a thread. You should better create it at the beginning of the Execute method and free it before returning from the execute method (With a try/finally construct). Your thread need to have a message pump or call the one in TWSocket to work properly. There are a few samples of threads in ICS distribution. Multi-threading is always more complex and overkill with an asynchronous component.
-
Use pure asynchronous operation.
-
You have to manage that yourself. Abort all communications when you detect the stop request and handle any error/exception before existing.
-
TSuperObjectIter ObjectFindFirst problem
FPiette replied to PizzaProgram's topic in ICS - Internet Component Suite
I mean the code you posted and which contains unknown function js_keres. -
Are you sure all communications are done when you stop your service? Remember ICS component are asynchronous and work in the background.
-
At first glance it is not correct. The component is asynchronous. Calling one method will merely start the process in the background. You shouldn't detach the component from the thread before it has finished the operation you requested. You should remind that ICS components are asynchronous and doesn't require multi-threading to execute a lot of operations in parallel. Multi-threading is only useful if you have a large number (hundreds) of active communications simultaneously. Other operations that your application does may require multi-threading, for example lengthy SQL requests if they don't use an asynchronous programming model.
-
Why not create your own ShowMessage function? After all it is simply a modal form that you can easily build yourself to fit your needs.
-
TSuperObjectIter ObjectFindFirst problem
FPiette replied to PizzaProgram's topic in ICS - Internet Component Suite
Please also fix your message. You can edit it. -
TSuperObjectIter ObjectFindFirst problem
FPiette replied to PizzaProgram's topic in ICS - Internet Component Suite
What is js_keres function? -
TSuperObjectIter ObjectFindFirst problem
FPiette replied to PizzaProgram's topic in ICS - Internet Component Suite
Use one of the functions: function ObjectIsType(const obj: ISuperObject; typ: TSuperType): boolean; function ObjectGetType(const obj: ISuperObject): TSuperType; -
TSuperObjectIter ObjectFindFirst problem
FPiette replied to PizzaProgram's topic in ICS - Internet Component Suite
Ask the developer! Before asking, read the SuperObject documentation. -
I have no idea about XSD but for sure you can do the check in Delphi using System.RegularExpressions to do the check.
-
You have to try the component in a sample application, creating the component at runtime. When it works, you can consider installing it in the IDE. That's not specific to that component but it is how any component has to be developed. When the component is in the sample application, you can use the debugger to understand where and why it blocks.
-
You probably forgot to change Winsock to OverbyteIcsWinSock. The use clause should be this: uses Windows, Classes, SysUtils, ExtCtrls, OverbyteIcsWSocket, OverbyteIcsWSocketS, OverbyteIcsWinSock;
-
How to build JSON with ISuperObject as an Array ?
FPiette replied to PizzaProgram's topic in ICS - Internet Component Suite
Is your problem solved? If not, on which line EXACTLY does your code cause an AV? Run your program under the debugger using the debug release. -
What is the problem with "Src : TSockAddrIn;" ? What error message give the compiler. You really have to help us to help you!
-
Override the form's DoShow procedure and from there post a custom message to the form. In the corresponding message handler restore the form position and size. If you want an example, look at https://github.com/fpiette/OvbImgOrganizer/blob/main/Source/OvbImgOrganizer.Main.pas
-
How to build JSON with ISuperObject as an Array ?
FPiette replied to PizzaProgram's topic in ICS - Internet Component Suite
On which line EXACTLY does your code cause an AV? -
Please describe the problem you get. And tell us which Delphi version you use.
-
In which space are your points? The formula and code I gave is for computing the distance between two points of given by their geographic coordinates (On a sphere which is the earth in my code). The distance is computed on a great-circle. The formula for two points located on a plane is different and simpler.
-
What is the relation with your initial question and my answer ?
-
If you are talking about geographic coordinates, look at the haversine formula. function HaversineDist( Lat1 : Extended; // Latitude of point 1 in degrees Lng1 : Extended; // Longitude of point 1 in degrees Lat2 : Extended; // Latitude of point 2 in degrees Lng2 : Extended) // Longitude of point 2 in degrees : Extended; // Distance in meters var Dx, Dy, Dz : Extended; const Diameter = 2 * 6372.8 * 1000; // Meters begin Lng1 := DegToRad(Lng1 - Lng2); Lat1 := DegToRad(Lat1); Lat2 := DegToRad(Lat2); Dz := Sin(Lat1) - Sin(Lat2); Dx := Cos(Lng1) * Cos(Lat1) - Cos(Lat2); Dy := Sin(Lng1) * Cos(Lat1); Result := ArcSin(Sqrt(sqr(Dx) + Sqr(Dy) + Sqr(Dz)) / 2) * Diameter; end;