You may need to initialise COM in the thread, i.e. by calling OleInitialize
(and OleUninitialize afterwards).
The other thing that comes to mind is that the mechanism of invoking and
passing parameters to the COM object may not be thread-safe. Have you tried
using Synchronize to call it?

----- Original Message -----
From: "Phil Middlemiss" <[EMAIL PROTECTED]>
Sent: Tuesday, October 22, 2002 5:00 PM
Subject: [DUG]: COM Object error


> I have an app that uses the Indy components to act as a TCP server. When
it
> get's a connection and receives the required data, the application uses a
> third party COM object to communicate the data to second server running on
a
> remote location.
>
> If I run a test routine and just send some dummy data to the second server
> then everything is fine. If I try exactly the same test code but this time
> call it when I have received some data from a connection to my TCP server,
> then I get an access violation from 'MSVBVM60.DLL' (the COM object was
> written in VB).
>
> I'm guessing its a threading issue since the TCP server is hanging on to a
> TIDPeerThread from it's Execute event. I've tried placing
> EnterCriticalSection etc around the code but it makes no difference.
>
> Does anyone have any ideas?
>
> Regards,
> Phil.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to