Jump to content

Search the Community

Showing results for tags 'otl'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 5 results

  1. Hello everybody, I'm a novice with the OTL. And I've written a simple app to experiment with it. But it causes the EOSError with the "System Error. Code: 1400. Invalid window handle." message in the TOmniContainerWindowsMessageObserverImpl.PostWithRetry method. Could anybody explain what is wrong with my code and (if it is not correct) provide a fix or solution? I use Delphi 10.2.3 (Tokyo) and OTL 3.07.9. Any help is appreciated. This is my code: unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses OtlParallel; {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin TThread.CreateAnonymousThread( procedure begin Parallel.Async( procedure begin Sleep(100); end); end).Start; end; end.
  2. Hrushikesh Shet

    OTL Upgrade From 3.05 to 3.07.8

    We are working on a legacy application that is built using Delphi XE6. We have used the Omni Thread library and have version 3.05: 2015-09-07 installed. We are planning to upgrade OTL from the above-mentioned version to the latest release version 3.07.8 (https://github.com/gabr42/OmniThreadLibrary/archive/release-3.07.8.zip). Are there any known issues or any new issues? Is it safe to upgrade? Thank You.
  3. We are working on a legacy application that is built using Delphi XE6. We have used the Omni Thread library and have version 3.05: 2015-09-07 installed. We are facing an issue while executing this OTL code. When the control reaches line aTaskControl.WaitFor(10000); it doesn't execute any task. It skips and terminates the thread. This is happening randomly and more specifically in our Production environment whereas in the Dev environment it works fine. In our task, we are connecting to our database and performing some checks and updating the records based on some business logic. Any inputs or suggestions will be really helpful and appreciated. Thanks.
  4. Delphi10.2.3: OTL, FMX, ACTIVEX DCOM i have a big problem in my code to call the parallel.Async many times i have 6 ActiveX DCOM in Delphi, and wanna call these in same time, to calculate an invoice, so in my exe i work with OTL to async all calls activex, i don't like to wait result or freeze my screen. Parallel.Async( procedure (const task: IOmniTask) var iInnerExc: integer; begin /// ***********************************************************/// { return Log} TLogSingleton.Instance().Log('Services XX calcul: Début appel.',True); //************************* PARALLEL ASYNC ****************************// // executed in background thread try // {Create instance de ViewModel annexes: XXServiceXX} mainViewModelPreCalculOTLLevel03 := CreateMainViewModelOTLLevel03Class; {Affecter le même Model principal} mainViewModelPreCalculOTLLevel03.Model := fModel; {Suscribe the observer in list} mainViewModelPreCalculOTLLevel03.Provider.Subscribe(fSubscriber); {Call VieModel.ServiceXX} mainViewModelPreCalculOTLLevel03.StartPrecalcul; except on e:exception do {call the raise, juste ci dessous, dans le onterminated Handle} raise Exception.Create('Exception lors du traitement de Service XX.'); end; end, Parallel.TaskConfig.OnTerminated( procedure (const task: IOmniTaskControl) var excp: Exception; begin // executed in main thread if assigned(task.FatalException) then begin {expoiler l'exception, captcher ci dessus} excp := task.DetachException; TErrorSingleton.Instance().Log(Format('Service XX: [Fin TASK Error]. %s:%s',[excp.ClassName, excp.Message]),True); FreeAndNil(excp); end else begin // executed in main thread { return Log} TLogSingleton.Instance().Log('Services calcul: [Fin TASK] Fin appel traitement.',True); SendNotification([actServiceXXFinish]); end; end )); the Active X Call in exe FMX: (the server activeX is integreted in framework, i don't have the source code, and i don't know haw it writen) _Dm_Dcom := CreateObject('SERVICE.XX.CLT.SERVICEXX', 'DEFAUT') as ICoServiceXX; //Instance of the DLL //CALL the function in ServiceXX_impl _Dm_Dcom.GETTRaitementServiceXX(SafeArrayIn,SafeArrayOut,FListnerForPushNotif ); //with SafeArrayIn =Json IN, and take result in SafeArrayOut; FListnerForPushNotif to send notification (Type Interface: Iunknow) the ActiveX initialization in every SERVICEXX (DLL) TAutoObjectFactory.Create(ComServer, TTest, Class_Test, ciMultiInstance, tmApartment); in this DLL; we have ServiceXX_impl unit, we have one function to call traitement in another class, we can found a communication with the IInterface (published) to send notif like this: (FListnerForPushNotif as IDataListnerForPushNotification).PushNotificationForLog('Message to send to client side'); //we have many logs types: event, Error, Exception //PushNotificationForLog, PushNotificationForError,PushNotificationForException this is my call, i repeat it 6 times, Parallel.Async( CALL01 ); Parallel.Async( CALL01 ); Parallel.Async( CALL02 ); Parallel.Async( CALL06 ); i don't need to freeze my exe, and i don't need to wait, with SendNotification([actServiceXXFinish]); or other Action like "actService01Finish", "actService02Finish" i can kown if my traitement is finished or not, finaly, if i write all 6 calls, i will fall in many and many problems, like freeze screen, and deadlock (the only solution kill the process crl+alt+supp), but if i write only one call, it will be perfect, i have, my result, but the freeze screen persist, Conclusion: 1- with many calls: problems: screen freeze, traitement not working, --> kill the process. 2- with one only call: problems: screen freeze: the "TAniIndicator" not working and the screen freeze when Delphi enter in the other DLL (activeX). Nota: the Exe is FMX (in another step it will be a Form application), the 6 services are DLL (ActiveX DCOM). plz help me
  5. In OTL (3.0.7), OTLCommon.TOmniAffinity.GetMask calls DSiGetSystemAffinityMask, DSiGetProcessAffinityMask and DSiGetThreadAffinityMask which all call Winapi.windows.GetProcessAffinityMask, which can fail (I don't know under what conditions, but clients are reporting that it happens under Wine and also on at least one windows 10 system). If it fails, the var returns lpProcessAffinityMask and lpSystemAffinityMask are undefined. OTL release 1.40 made some changes to support 64 bit, and so I think in most places this behaviour won't show. However, for example OTLCommon.TOmniAffinity.GetCount has affMask := Mask; where affMask is a DWORD and mask is the NativeUInt property. An ERangeError won't be thrown unless: 64 bit arch range checking on GetProcessAffinityMask throws the second 64-bit param (lpProcessAffinityMask) value comes back as an invalid 32 bit value (I assume, under whatever conditions that trigger this issue, winapi doesn't change the stack val, so for example whatever was in that position happened to be an invalid 32 bit value) So my suggestion is that anywhere getProcessAffinityMask is called (I think just 3 places), it is checked for failure and if so some reasonable value is returned, eg if not GetProcessAffinityMask(GetCurrentProcess, Result, systemAffinityMask) then result := 1;
×