I am trying to expand a third-party application so that it can be called via the command line in addition to using the graphical interface of the Windows form (preferably mixed mode). This is a fairly simple program that basically downloads the file, and then you press the button and it starts sending UDP network packets.
I need to call an application from another and would like to pass an argument and should be able to return ExitCode to the calling application. From what I read, for this you need to add the {APPTYPE CONSOLE} compiler directive.
I did this, and my application worked the way I wanted it, except that network packets slowed down to bypass. I found that whenever I hover over a form. That the network transfer rate has increased significantly. I suspect that there is some Windows Message Queuing problem, and moving the mouse causes interrupts, which in turn cause message queue processing?
I have googled around and tried calling Application.ProcessMessages and PeekMessages in a timer at 1 ms intervals, and that didn't help at all. I found in this user guide for some other application , it says that Indy 10 is supported both in the APPTYPE CONSOLE types and in the GUI. Honestly, it just bothers me, since I assumed that the entire network library would work in both modes ... but, as I said, I'm not familiar with Delphi.
I am sure that the problem is isolated from a single line in my application, and that is whether or not {APPTYPE CONSOLE} is included.
Does anyone have any idea?
Version Information:
Delphi 7 Personal (Build 4.453)
Indy 9.0.4