Search found 35 matches

by Ahmed Sayed
Tue Mar 12, 2019 7:53 am
Forum: Technical
Topic: Check if an indy Http server is active by indy client issue!
Replies: 7
Views: 21774

Check if an indy Http server is active by indy client issue!

Hi I am creating an app to monitor some of my http servers so in case they are down I get notified by email. I used this code to check for the connection if it is active or not: bool SocketIsOpen( UnicodeString Host, int Port, String &Msg, int ATimeout) { unique_ptr<TIdTCPClient> Socket(new TIdTCPCl...
by Ahmed Sayed
Wed Feb 20, 2019 8:58 am
Forum: Technical
Topic: Call a non class function with RTTI
Replies: 1
Views: 11203

Call a non class function with RTTI

Hi, is it possible to call a unit function not a function that belongs to a class from rtti? In TRttiMethod.Invoke I have to set the instance parameter is there another mechanism that can allow me to invoke functions like: Today, Now, Date, ReplaceStr, SplitString but with rtti or by their name? Any...
by Ahmed Sayed
Fri Feb 08, 2019 9:59 am
Forum: Technical
Topic: Inject code in TDataSet Events for all datasets in a project
Replies: 1
Views: 11261

Inject code in TDataSet Events for all datasets in a project

Hi, I am trying to inject a logging mechanism to identify the user created the record from a Users table in the database and set them on the AfterInsert, BeforePost Events for the fields (CreatedBy, CreatedDateTime, ModifiedBy, ModifiedDateTime) if they exists in the dataset instance. The (LoggerUse...
by Ahmed Sayed
Tue Feb 05, 2019 3:11 am
Forum: Technical
Topic: IDE suddenly not compiling !!! PLEASE HELP
Replies: 3
Views: 12678

Re: IDE suddenly not compiling !!! PLEASE HELP

Sure. I even restarted windows 10 many times. Actually at first it didn't want to generate the executable as well running app with debugging tells me that it can't create the process and running without debugging says it can't find the process. After a restart it managed to run the project but no bu...
by Ahmed Sayed
Mon Feb 04, 2019 2:06 pm
Forum: Technical
Topic: IDE suddenly not compiling !!! PLEASE HELP
Replies: 3
Views: 12678

IDE suddenly not compiling !!! PLEASE HELP

Hello, I was trying the plugin called Delphi IDE Colorizer but it was slowing down Code editor scrolling. So i removed it but after that whenever i try too compile a unit or build a project in C++ Builder I get this error with no description what so ever: error.png And its very weird and i can't fin...
by Ahmed Sayed
Thu Jan 31, 2019 9:09 am
Forum: Technical
Topic: Support paging in FireDAC !!!
Replies: 0
Views: 10115

Support paging in FireDAC !!!

I am trying to support paging in FireDAC like websites do. Let the user choose how many records to show and display the pages count as it should be. But i can't achieve this with FireDAC on REST Server (RAD Server) I mean how can I get first the total count of records although I have my TFDQuery Fet...
by Ahmed Sayed
Thu Jan 31, 2019 9:01 am
Forum: Technical
Topic: Get Process CPU Usage by its PID or HANDLE?
Replies: 6
Views: 17175

Re: Get Process CPU Usage by its PID or HANDLE?

Thanks I manged to get close enough from task manager values using this for now: void TMain::GetCPUUsage() { ULONGLONG LastCycleTime = NULL; LARGE_INTEGER LastPCounter; LastPCounter.QuadPart = 0; // LARGE_INTEGER Init SYSTEM_INFO sysInfo; GetSystemInfo(&sysInfo); int numProcessors = sysInfo.dwNumber...
by Ahmed Sayed
Mon Jan 28, 2019 12:20 pm
Forum: Technical
Topic: Get Process CPU Usage by its PID or HANDLE?
Replies: 6
Views: 17175

Re: Get Process CPU Usage by its PID or HANDLE?

yeah couldn't agree more WMI is worst think in development i could think of but i found the solution in this discussion https://groups.google.com/forum/#!searchin/comp.os.ms-windows.programmer.win32/how$20to$20get$20cpu$20usage$20by$20prcess%7Csort:date/comp.os.ms-windows.programmer.win32/aZX3b9zY67...
by Ahmed Sayed
Sun Jan 27, 2019 4:18 am
Forum: Technical
Topic: Get Process CPU Usage by its PID or HANDLE?
Replies: 6
Views: 17175

Re: Get Process CPU Usage by its PID or HANDLE?

My mistake the exception was for something else but the first code listing is for a test app that i am trying to monitor the current app cpu usage but when i run another instance of the same app it still shows me the cpu usage for the first instance how can i get cpu usage for a certain process with...
by Ahmed Sayed
Sat Jan 26, 2019 9:19 am
Forum: Technical
Topic: Get Process CPU Usage by its PID or HANDLE?
Replies: 6
Views: 17175

Get Process CPU Usage by its PID or HANDLE?

hi, I am trying to monitor a some programs from another main program that will monitor cpu usage for any instance of the other programs. I tried using PdhAddEnglishCounter but with no luck to get an external (another process) cpu usage. I only managed to get current process and for only 1 instance i...
by Ahmed Sayed
Tue Jan 22, 2019 5:53 am
Forum: Technical
Topic: REST request failed: Error receiving data: (12152) The serve
Replies: 2
Views: 11325

Re: REST request failed: Error receiving data: (12152) The s

Here is the code: Client code: void TMain::Execute(String aFramework, String ID) { if (aFramework == "REST") Thread(FuncBind( &TMain::RESTExecute, this,ID)); if (aFramework == "Net") Thread(FuncBind( &TMain::NetExecute, this,ID)); if (aFramework == "Indy") Thread(FuncBind( &TMain::IndyExecute, this,...
by Ahmed Sayed
Sun Jan 20, 2019 4:29 pm
Forum: Technical
Topic: REST request failed: Error receiving data: (12152) The serve
Replies: 2
Views: 11325

REST request failed: Error receiving data: (12152) The serve

Hi, I am facing a problem when I try to stress test a server using TIdHttpServer I am creating to be fast I am using TRESTClient, and request components to create the test on the client side. I use both the client tester and server on the same machine The test is based on creating like 20,000 thread...
by Ahmed Sayed
Tue Jan 08, 2019 12:12 pm
Forum: Technical
Topic: C++ Builder change project folder causes IDE to loos files
Replies: 2
Views: 14024

Re: C++ Builder change project folder causes IDE to loos fil

It is complaining about some .cpp files that have my code in the file it self is not the issue. The problem is that this happen quit often now when I move a project from one folder to another. And yes the paths are stored in relative format in the project file for example: "..\..\..\..\Classes\" I h...
by Ahmed Sayed
Tue Jan 08, 2019 6:40 am
Forum: Technical
Topic: C++ Builder change project folder causes IDE to loos files
Replies: 2
Views: 14024

C++ Builder change project folder causes IDE to loos files

Hi, I am facing an issue every time I move one of my projects from one folder to another, when i recompile or build the app again the IDE complain about missing files that it can not open or locate while they are already added to the project. So i had to remove them all and add them one by one. Now ...
by Ahmed Sayed
Sun Nov 18, 2018 3:21 am
Forum: Technical
Topic: Testing TIdHTTPServer in debug mode Win64 issue
Replies: 10
Views: 22933

Re: Testing TIdHTTPServer in debug mode Win64 issue

Thanks for the reply I will build the cache my self then.