Link to home
Create AccountLog in
Avatar of starhu
starhu

asked on

Delphi Multithread error

I use a free Opc client: Simple OPC Client.
I used a part of it in  TThreadbe (it needs to check if a parameter was changed in the background), but there is an error message when writing to the server after "while not Terminated do"  

The error: " Project xx.exe raised exception class EIntfCastError with message 'Interface not supported' "

Code snippet:
  IOPCSyncIO = interface(IUnknown)
    ['{39C13A52-011E-11D0-9675-0020AFD8ADB3}']
    function Read(
            dwSource:                   OPCDATASOURCE;
            dwCount:                    DWORD;
            phServer:                   POPCHANDLEARRAY; {was ptr mgl}
      out   ppItemValues:               POPCITEMSTATEARRAY;
      out   ppErrors:                   PResultList): HResult; stdcall;
    function Write(
            dwCount:                    DWORD;
            phServer:                   POPCHANDLEARRAY; {was ptr mgl}
            pItemValues:                POleVariantArray;
      out   ppErrors:                   PResultList): HResult; stdcall;
  end;
SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of starhu
starhu

ASKER

Hello,

We tried it, but unfortunately the error is the same.

I can send you more code in private if that helps...
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of starhu

ASKER

Thank you for your answers!