WebMay 4, 2024 · Regarding the string, that could be a problem if you are casting from a regular Delphi string. Delphi strings are reference counted, so by the time your message handler tries to access the string, it may have been deallocated. It might be a good idea to allocate the string yourself with StrNew. – Dangph May 3, 2024 at 5:43 Thanks for the idea. WebOct 31, 2015 · How i can pass pchar from the DLL? dll must be compatible with other apps, not just delphi. In help is written that it is dangerous to pass pointers to local variables, if we make this variable global, the code will not be thread-safe. We can safely pass a wide string,but in this case, the dll will not be compatible with other (non-Delphi) apps.
Passing PChar from the Delphi DLL - Stack Overflow
WebMay 14, 2013 · Use one Logging thread that dequeues the TStringList instances, writes them to the file and then frees them. This isolates the log writes from disk/network delays, removes any reliance on dodgy file-locking and will actually work reliably. Share Improve this answer Follow answered May 14, 2013 at 13:13 Martin James 24.3k 3 35 58 http://www.delphigroups.info/2/04/521955.html pack of animals names
4. Concurrent Programming - Delphi in a Nutshell [Book]
WebDec 2, 2024 · Is OutputDebugString (PAnsiChar ('')); thread safe? I/we have been using it in threads for debugging, and it never occurred to me if I should be doing it a different way. (Delphi 7) multithreading delphi delphi-7 outputdebugstring Share Improve this question Follow edited Dec 2, 2024 at 22:49 Peter Mortensen 31k 21 105 126 WebFeb 20, 2024 · Yes, then FPass will be guaranteed to point to a long string heap object of refcount 1. – Andreas Rejbrand Feb 20, 2024 at 13:27 2 If there is no writing after multiple threads start accessing the data, then reading is thread safe. But your question would be more clear if you have added some code. Webprocedure TThreadStringList.SetValues(const Name: string; S: string); begin LockList; try FStringList.Values[Name] := S; finally UnlockList; end; end; function … jerome moments spa lotion yellow