Board index » delphi » Automation controller locking up

Automation controller locking up

Hi,

I'm controlling Word from Delphi. I have a main application in D5
dynamically linking to a dll also written in D5. The dll has a load of Word
code in it which works fine. I'm using late binding to avoid needing a type
library.

What seems to happen is that 'on occasion' the main application locks up and
the screen doesn't refresh. If I put a load of ShowMessage boxes throughout
the dll routines and within the appropriate main application's routines no
problem ever occurs. Take them out and the main application often 'appears'
to stop responding. I have to Ctrl+Alt+Del to resume testing.

In the main application the function calling the dll routines has a finally
clause at then end which looks like this:

    finally
      FreeLibrary (HInst); // unloads the dll containing Word API's
      frmMain.Update;
      ShowMessage ('Responding'); // if it hasn't locked it shows message
    end

Sometimes, this appears to run and sometimes it doesn't. It's a regular
problem but difficult to reproduce with certainty. Hence, I've been down
many blind allies. It does appear though that when the Word window is
positioned on top but not focused then I can reproduce the occurrence with
greater regularity.

Has anyone had any such experience? I've checked through Deborah Pate's web
site and this newsgroup for an answer but so far no luck. It could be that
the message boxes slow things down to allow the screen to refresh itself. Is
the form updating right? I've also tried:

frmMain.Refresh;
frmMain.Canvas.Refresh;

Thanks

Paul

 

Re:Automation controller locking up


Forget that post. I think I've found the problem. The dll was crashing on
occasion.

Thanks Paul

Quote
> Has anyone had any such experience? I've checked through Deborah Pate's
web
> site and this newsgroup for an answer but so far no luck. It could be that
> the message boxes slow things down to allow the screen to refresh itself.
Is
> the form updating right?

Other Threads