I have a weird problem I don't know how to solve. Tried to google about it, but so far I've been unsuccessful.
I have made a multithreaded application using a class derived from TThread. But my thread was acting strange. It would only work as long as I kept moving mouse on my Form or if I had a cursor blinking somewhere. If I removed focus from the Form on some other windows the Thread freezes until I move the mouse over it again.
I tried to locate the problem by commenting out parts of my code and I found out that when I commented out all the functioncalls that were included in the project through dll import (extern "C" __declspec(dllimport) void functionname();), the thread starts working normally.
Btw, those functions are not even called inside that thread. They are called in OnFormCreate event. I tried to remove them from there and moved them to ButtonClick function and then launch the thread without pressing the button and I still had that bug.
Anyone has any ideas what could be causing this?
Thanks in advance