DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   Watched TopicsWatched Topics     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Why the software deadlock?(tpicshow)

 
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
guan_2000
Member


Joined: 16 Sep 2006
Posts: 3

PostPosted: 16/09/06 06:00    Post subject: Why the software deadlock?(tpicshow) Reply with quote

I use the control tpicshow now. Version : 4.03 .The software will deadlock in the individual computer when "threaded" is true.
Particularly new computer .I have more than 800 customers
in the use of software products . More than 30 users Software will deadlock.If i Set up parameters of "threaded" false, The software would not deadlock.
All the computer of deadlock happened is purchased recently .
Who can help me? Crying or Very sad
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 16/09/06 13:53    Post subject: Reply with quote

You have to re-check your code of the control's event handlers. Probably they are not thread-safe.
_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guan_2000
Member


Joined: 16 Sep 2006
Posts: 3

PostPosted: 16/09/06 16:25    Post subject: Reply with quote

thank you very much!
I have no writed code of the control's event handlers.
I writed a control nameed TMCtrlPicText, the control Contains tpicshow.
my part of code:
Code:
type
  TMCtrlPicText = class(TPanel)
  private
    { Private declarations }
    FFlash: TShockwaveFlash;  //in deadlock testing ,assign the nill
    FRxGif: TRxGIFAnimator;   //in deadlock testing ,assign the nill
    FPicShow: TPicShow;
    FMovie: TActiveMovie;     //in deadlock testing ,assign the nill
    ...
    ...

procedure TMCtrlPicText.Open(aContainer: TElementContainer; wait: boolean; timeset: integer);
begin
...
        FPicShow := TPicShow.Create(self);
        FPicShow.Parent := self;
        FPicShow.Width := Width;
        FPicShow.Height := Height;
        FPicShow.Left := 0;
        FPicShow.Top := 0;
        FPicShow.Visible := false;
...
end;

destructor TMCtrlPicText.Destroy;
begin
   ...
    FPicShow.Free;
    inherited;
    ...
end;

procedure TMCtrlPicText.Play;
begin
     ...
            FPicShow.Picture.Assign(TMPicText(FContainer.ElementList.Objects[FCurBusyElement]).GetBitmap);
            Randomize;
            FPicShow.Style := Random(170);
            FPicShow.Execute;
            Invalidate;
           SetTimer(Handle,1,50,nil);
    ...
end;

procedure TMCtrlPicText.TimerTick(var Msg: TMessage);
begin
    ...
    if FPicShow.Busy then
    ...
    //check the control whether the 'busy' is false.If the 'busy' is false,my control is 'free'.

end;

the master code creat my control on-line ,waiting...,free,
Next the master line creat the control on-line again,assign another the value,plots the above process.

//Mod - Added code tags[/code]
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 17/09/06 13:52    Post subject: Reply with quote

Instead of checking PicShow's status using a timer, try to use OnStop event of the control. When OnStop event is raised, start a timer to release your object after a short delay.

Also, after executing PicShow, you do not need to call Invalidate.

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guan_2000
Member


Joined: 16 Sep 2006
Posts: 3

PostPosted: 20/09/06 06:13    Post subject: Reply with quote

In fact,after i check the control's 'busy' is false,the timer delay 5 seconds for picture display, then,my control is 'free'.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

Add to favorites

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group