View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000863 | JEDI VCL | 00 JVCL Components | private | 2003-04-11 04:49 | 2004-08-03 07:19 |
| Reporter | anonymous | Assigned To | |||
| Priority | normal | Severity | block | Reproducibility | always |
| Status | closed | Resolution | open | ||
| Product Version | 2.00 | ||||
| Target Version | Fixed in Version | ||||
| Summary | 0000863: Thread doesn't work. | ||||
| Description | I "load" a TForm from a DLL (I previously load the DLL with LoadLibrary and set the DLL Application.Handle to the Main Application.Handle). A jvTimerList component belongs to this form and I created a Timer that shows a dialog every 5 seconds but it doesn't work at all. If I create the jvTimerList and its Timer in the main form then it works. It seems like there's no message flow between the main application and the form in the DLL. | ||||
| Tags | No tags attached. | ||||
|
|
I don't think you can run threads like this: there is no message pump in the DLL, so the timer triggers are never called. I could be wrong, though.... |
|
|
Yesterday I ran into another "bug" with a threaded component. Placing a TJvThreadedTimer on a form that is to be shown modally (and not the main form) doesn't work very well. The events are not fired unless you happen to move your mouse over the main form. I ended up using a normal TTimer (which did work). I suspect this problem happens with other components that use threads as well. Surprisingly TJvScheduledEvents doesn't have this problem at all. The only difference: TJvScheduledEvents doesn't use Synchronize to post a message to the main form but posts a message directly to the component itself. Maybe the same problem happened with DLL form (not sure, not tested). Haven't tested if the TJvThreadedTimer works when placed on the main form and a modal form is displayed either. Should we look into rewriting all thread based components to post a message to itself, instead of relying on Synchronize? |
|
|
Let me quote one of my former co-workers: "Does it say anywhere that it *should* work?" <vbg> Seriously, without knowing for a fact that the reason for thread not working in DLL's is caused by using Synchronize instead of messages, we might create more problems than we solve if we reimplement. Comments? |
|
|
About the commment from Marcel. I think there is a difference betweeen D5 <> D6,D7. The D6,D7 implementation of synchronization TThread uses a WM_NULL message send to TApplication (wake-up call). Thus, I can't reproduce the behaviour Marcel described on D6,D7. If you use a dll you probably have to assign a value to var WakeMainThread from Classes.pas |
|
|
Oddly enough I can't reproduce my problem in D5 either. I tested: * TJvThreadTimer on main form * TJvThreadTimer on modal form * TJvThreadTimer on modal form in DLL in all cases all timers are triggered, even if I call ShowMessage when the forms are shown. This also means the original reported problem (about DLL use) does not apply to TJvThreadTimer. Haven't tested TJvTimerList in this case, so it might be a bug in that component. I'm a bit confused about the fact that I get the TJvThreadTimer working now on a modal dialog, when at first (when I actually needed it) it didn't. Have to look into that, because there might be other issues involved that do not apply in this test case scenario... |
|
|
Can we assume this issue resolved? |
|
|
Don't know. As mentioned in my last post the issue I experienced at first had vanished without any change (well, it was a new test application). I haven't looked at the whole issue since so I'm not sure if the originally reported issue is solved or not. |
|
|
Since it seem the original poster lost interest, let's just close it and if he ever comes back, he will have to post a new issue. I don't like these old stale reports: they just lie around forever without resolution. |
|
|
This bug has not had any activity for more than a month, it is therefore considered closed. To the original poster: If you think the issue is still there, even after having tested with the JVCL3, please create a new bug report. |