- DELPHI XE10 SYSTEM ERROR CODE 1400 FOR ANDROID
- DELPHI XE10 SYSTEM ERROR CODE 1400 CODE
- DELPHI XE10 SYSTEM ERROR CODE 1400 WINDOWS
DELPHI XE10 SYSTEM ERROR CODE 1400 FOR ANDROID
Compile for Android API 30! Android API and Libraries updated - API 30, Google Play V3, Android X.You can now compile for both existing Intel, and the new M-series macOS processors (Apple Silicon). Compile for macOS (M-series Apple Silicon) and use the new universal package for AppStore submission.
DELPHI XE10 SYSTEM ERROR CODE 1400 WINDOWS
Rapidly produce application bundles that can be deployed to Windows Store, Apple App Store and Google Play Store.
DELPHI XE10 SYSTEM ERROR CODE 1400 CODE
Since GUI objects in a Delphi application are created in the context of the main thread (unless you have jumped through some serious hoops to create UI elements in some other thread), then any code in a thread which attempts to interact with Delphi UI elements is highly likely to fall foul of this architectural feature of the WinAPI.Īs others have said, the simplest approach is to ensure that only non-UI code is performed in a thread. Indeed, this is one of the simplest, tho most basic, mechanisms for ensuring synchronised communication between threads (exploiting the UI element owner threads message queue)Īny code in a thread which ends up trying to work with a window handle (other than via messaging) that it did not create is likely to get this error (in practice, the offending WinAPI call will fail and you will only see this error if the call is followed by error checking code that raises the appropriate exception). The Windows API forbids a thread from directly working with a window handle that was created (and "belongs") to another thread.Īn exception to this is the messaging system - it's perfectly valid (and indeed, expected) for a thread to Post or Send a message to a window handle owned by another thread. Maybe you're accessing properties of a window that doesn't exist anymore, or maybe you're using an uninitialized variable. But if you get the error in one of the other functions you call, like Connect or SyncText, then you'll need to take a look there, too. If you get it in the ProcessMessages call, then that's probably where the problem is. You haven't said where you get the "invalid window handle" exception. If your thread routine were a function like it's supposed to be, then you could just return a value like any ordinary function. (Even if you're not using multiple threads, the presence of Application.ProcessMessages is an indication that a program has design problems. Begin by reading about GetMessage, PeekMessage, and DispatchMessage. If you want to process messages in your worker threads, then you'll need to write the message-processing code yourself. When you call ProcessMessages, you're using the VCL-thread-processing code to process a different thread's message queue, and then all the assumptions that code makes about which queue it's processing are wrong. The Application object assumes it's processing the main VCL thread's message queue. Message queues belong to specific threads.
![delphi xe10 system error code 1400 delphi xe10 system error code 1400](https://www.gnostice.com/images/SCREENSHOT-XtremeDocumentStudio-Delphi-Firemonkey-Viewer-Slideshow.gif)
One is that you call Application.ProcessMessages.
![delphi xe10 system error code 1400 delphi xe10 system error code 1400](https://i.stack.imgur.com/zwgiz.png)
When we get to that, there are other problems. That's all independent of anything you do in the thread. It will correctly mark your program as being multithreaded so that the memory manager knows to use proper protection for all further allocation operations. It needs to match the one described in the documentation.įurthermore, you should not call CreateThread directly. The signature of the thread function is wrong.