-
Content Count
1196 -
Joined
-
Last visited
-
Days Won
16
Everything posted by FPiette
-
Batch / bulk email program that reads a database for addresses.
FPiette replied to Plainer's topic in ICS - Internet Component Suite
This is because the component is asynchronous: start some operation which is executed in the background while you own code continue. When operation is finished in the background, you receive an event. Your program should use the async way of programming. That is no loop but events and messages. Code outline: 1) procedure to do your SQL request then PostMessage a custom message 2) from the handler of this custom message, take current record and start sending a mail. If EOF then you are done. 3) handle all SMTP component events, chaining commands for OnRequestDone until the mail is fully sent 4) when mail fully sent, use PostMessage to post the custom message. Those 4 step are NOT in line in a single procedure ! They are "chained" thru events or custom message, just like "All-in-one" button does -
Is interposer class really best to customize TPanel.Paint?
FPiette replied to Mike Torrettinni's topic in VCL
I really don't agree with this sentence! Creating a separate package helps having clean code which is reused easily. Registration is just one procedure call in the design time package. You write it one and forget it. You don't replace an existing panel: you use your specialized one when needed instead of the standard. You have both the standard panel and your specialized available in the component toolbar. You can even use both in the same form without worrying. There is no bundling with app required. Simply don't add that package in the run time package list. The component code will automatically bundled in the application. Nothing to deploy. Building component is the best solution. You do it once and them you use it. If you have an existing application and want to use your specialized panel, it is easy to edit the .dfm and .pas files using an external editor (NotePad or NotePad++) to do a simple search and replace to change TPanel by TMyPanel where is is needed. It is always easier to do that edit than opening the form, deleting the standard panel, dropping the specialized panel and reassigning properties and events! -
Is interposer class really best to customize TPanel.Paint?
FPiette replied to Mike Torrettinni's topic in VCL
Instead of an interposer class, I would simply create a new component inheriting from TPanel. The component code is what @DaveNottage shown except for the class name. Then this component is added to a package (Actually two: a run time and a design time package) so that it can be installed in the IDE and available where you need: you drop your specialized component on the form/frame instead of the standard panel. If you don't know how to create your component, there are a lot of tutorials on the Internet showing how to create your own TMyButton. It's the same process with a panel Google is your friend. -
Calling an "application" from windows service
FPiette replied to Clément's topic in RTL and Delphi Object Pascal
Be aware that running an executable is a slow process. If you put the same code in a DLL, this can stay loaded as long as you decide to. You may unload the DLL for example when the last request occured 5 minutes ago. If you prefer the EXE, then you may manage to let it run as long as you need, avoiding a new start for each request. The only difference is that you'll pass the arguments not thru the command line but thru some IPC (named pipe is quite fast). And why not a secondary HTTP server? -
TFtpClient: Very low speed on transfer data
FPiette replied to Alexey Ischuk's topic in ICS - Internet Component Suite
First remove any display and logging. This slow down considerably the server. Use display (Progress and so on) and logging for debugging purpose or apply a strategy more complex that what is in the demo. -
Calling an "application" from windows service
FPiette replied to Clément's topic in RTL and Delphi Object Pascal
This is not very clear to me. Are the users HTTP clients connected to the HTTP server? Are those client local or remote? Your "app" look like a standard console mode executable. Your service can call it calling CreateProcess but be aware that a service run with a special account, even when no user is logged in Windows and certainly not the user that has logged in Windows. The account for the service has different permissions from the logged in user. You must grant all required permissions and it is not easy to "impersonate" the user that a HTTP client is representing. -
What options do I have to control custom releases?
FPiette replied to Mike Torrettinni's topic in General Help
I put all options into a single executable and at run time, I read a configuration file to set the features enable Boolean variables. The configuration file is an INI file which is protected by a digital signature the customer receive with his license. If he manually edit the INI file, then the signature is invalidated and the product fall back to demo mode. Using this method, there is only one executable and producing a new release is easy: every customer get the features his license allow, nothing more, nothing less. Each customer can download the executable to get an update. Since you use Delphi, you already know that Embarcadero is doing the same: The installer contains all versions, all languages. You get the pro version if you pais a pro license. You get the enterprise version if you paid for it. As easy as that. -
How to keep track/organize all overloaded, extended 3rd party source code?
FPiette replied to Mike Torrettinni's topic in General Help
I'm a long time developer of open source components and I know this problem very well. The idea is not to ask the component developer to implement something you'd like but ask very simple thing like making a method virtual or change a method visibility from private to protected. Then you'll be able to implement yourself what you need in a derived class. Asking for such simple things which present almost no risk to break something is likely to succeed. But asking the component developer to implement something for you will probably be rejected. You'd better chances to implement it yourself and suggest your changes. -
How to keep track/organize all overloaded, extended 3rd party source code?
FPiette replied to Mike Torrettinni's topic in General Help
I don't usually modify 3rd party source code. Sometimes, I inherit from the 3rd party, adding my code only in separate source. If what I need cannot be done with inheritance en encapsulation, if I still find the 3rd party code valuable, I contact the author asking him to make some methods virtual or expose new properties. If he doesn't want, then I don not use his code because - as you experience - it will be a lot of work in the future. -
Runtime Error with OverbyteIcsSslMailSnd.exe
FPiette replied to Plainer's topic in ICS - Internet Component Suite
This is the command line OpenSSL tool. That is not what you need at this stage. You need the OpenSSL DLL. The name of the DLL depends on the version. For OpenSSL 1.1, there are two DLLs: libssl-1_1.dll and libcrypto-1_1.dll. They are in the same directory as the OpenSSL.exe that you found. If not, your ICS setup is corrupted. -
ICS v8.64 can't compile on Delphi 7
FPiette replied to Kyle_Katarn's topic in ICS - Internet Component Suite
Remove inline everywhere you see it. -
FTP use two connections. One for commands and one for data. FTP OnRequestDone event is triggered for every command once executed. Did you had a look at the source code ? OnRequestDone event has an argument RqTyp of type TFtpRequest which is an enumeration of all 78 FTP commands. When in the IDE, use CTRL+Click to immediately jump to any identifier definition.
-
List of HTTP status code.
-
There is no such thing as "full help". The documentation is in the source code (Component and samples) and on http://wiki.overbyte.be The wiki can be updated by anyone willing to share his knowledge. Just ask write permission.
-
TWSocketThrdClient and THttpCli.Post in socket thread
FPiette replied to Dmytro Lendel's topic in ICS - Internet Component Suite
HTTP component is asynchronous, it doesn't need a thread to be non blocking. It will consume very few CPU. As I see your application, you don't need multithreading at all. A thread would be necessary if - for example - you have a lengthy computation. -
If the problem is reproducible, try running the application under the debugger. If it only happens on the customer computer, ask him if you can use Delphi Remote Debugger thru Internet. The debugger will readily show where the exception occurs. And by the way, try downloading the same file using one of ICS demos to be sure the issue is located in ICS or in your application. François
-
Windows 10 vs Windows 7 SMTP/Winsock issue
FPiette replied to GillesL.'s topic in ICS - Internet Component Suite
It is likely an issue of a security product. Maybe a firewall or an "internet security" product which monitor outgoing connections. You must enable connections done by your application into those products. -
ICS FTP demos not working. Unable to get a file from an ftp site
FPiette replied to CosticaM's topic in ICS - Internet Component Suite
Try with passive mode. -
The download should always be done from http://wiki.overbyte.eu/wiki/index.php/ICS_Download which is more up to date. Currently, V8.64 is the latest stable version recommended.
-
I don't see anything wrong in line 277. Strangely both files have an error at the same line, same column. Download ICS again and retry.
-
Angus, this model is not suitable for CGI. A CGI module is expected to run as quickly as possible. If a queue and retries have to be done, it must be launched independently by the CGI so that it becomes an independent process. Or the CGI could call a service doing the actual send. Or other similar solutions.
-
ICS v8.64 can't compile on Delphi 7
FPiette replied to Kyle_Katarn's topic in ICS - Internet Component Suite
Simply remove the inline keyword. This will not affect the function, only the performance. -
TSslHttpRest - 429 (Too Many Requests) - resend request
FPiette replied to Anxich's topic in ICS - Internet Component Suite
Maybe there is a caching device between your application and the server. This device always returns the same result. Just a guess. -
Filling and submitting a form programmatically with ICS
FPiette replied to Carlos Tré's topic in ICS - Internet Component Suite
You need to look at your form. "Action" is the URL you have to use to submit your form. "Method" is the way to submit if: Get or Post which maps directly to HTTP component. Then you have to look at all "input" tags to find the name of the items to send. Then you have to format a buffer with name/values pair and submit it. François Piette -
That is correct. But this doesn't prevent ICS from being used from several threads. ICS do not need multithreading to do simultaneous operations on hundreds of sockets. It works nicely on a single thread. You only need multithreading if you need thousands of ACTIVE communications. And you need thread to off-lone the communication thread from processing. For example, if you have a lengthy database request and use a synchronous (blocking component) then you need a worker thread for the blocking database request. If you create a thread for each communication, you'll be quickly have poor performances. The best is to balance number of thread and number of connections. If well designed, you can develop an application using ICS having as much thread as the CPU core and each thread handling hundreds of connections. Whatever component you use, it is sure that handling thousands of simultaneous active connections requires proper design and proper hardware.