View Issue Details

IDProjectCategoryView StatusLast Update
0000863JEDI VCL00 JVCL Componentsprivate2004-08-03 07:19
ReporteranonymousAssigned To 
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionopen 
Product Version2.00 
Target VersionFixed in Version 
Summary0000863: Thread doesn't work.
DescriptionI "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.
TagsNo tags attached.

Activities

user72

2003-05-01 08:50

  ~0001988

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....

marcelb

2003-05-03 02:39

manager   ~0002006

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?

user72

2003-05-19 13:06

  ~0002068

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?

remkobonte

2003-05-19 13:35

developer   ~0002072

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

marcelb

2003-06-06 03:00

manager   ~0002173

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...

user72

2004-04-02 10:54

  ~0003588

Can we assume this issue resolved?

marcelb

2004-04-02 11:15

manager   ~0003608

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.

user72

2004-04-03 00:36

  ~0003615

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.

obones

2004-08-03 07:19

administrator   ~0004881

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.

Issue History

Date Modified Username Field Change
2004-04-02 10:54 user72 Note Added: 0003588
2004-04-02 11:15 marcelb Note Added: 0003608
2004-04-03 00:36 user72 Note Added: 0003615
2004-08-03 07:19 obones Status feedback => closed
2004-08-03 07:19 obones Note Added: 0004881