Recent

Author Topic: Indy example returns Runtime Error (211)  (Read 6071 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1165
    • HowTos Considered Harmful?
Indy example returns Runtime Error (211)
« on: November 20, 2011, 01:25:45 pm »
I am trying to use an Indy example from stackoverflow - http://stackoverflow.com/questions/576538/delphi-how-to-get-all-local-ips and I always get Runtime Error (211).

 
Code: [Select]
idStack := TIdStack.Create;
  TIdStack.IncUsage;
  try
    network := idStack.LocalAddress;
    mmoResults01.Lines.Assign(idStack.LocalAddresses);
    //PrintLines(idStrings);
  finally
    TIdStack.DecUsage;
  end;
  FreeAndNil(idstack);

Any ideas?
Lazarus 3.0/FPC 3.2.2

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12896
  • FPC developer.
Re: Indy example returns Runtime Error (211)
« Reply #1 on: November 20, 2011, 01:32:02 pm »
It's an example for Indy9, are you using indy 9? If so where did you obtain it?

vfclists

  • Hero Member
  • *****
  • Posts: 1165
    • HowTos Considered Harmful?
Re: Indy example returns Runtime Error (211)
« Reply #2 on: November 20, 2011, 01:49:32 pm »
It's an example for Indy9, are you using indy 9? If so where did you obtain it?

My version of Indy , 10.2.0.3  uses the code that is described as Indy 9 in the question. The example for Indy 10 is not implemented in 10.2.0.3
Lazarus 3.0/FPC 3.2.2

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12896
  • FPC developer.
Re: Indy example returns Runtime Error (211)
« Reply #3 on: November 20, 2011, 08:39:51 pm »
Afaik one must add a binding using the binding (bindings?) property for all interfaces (0.0.0.0)

This is a Indy9-10 difference.

vfclists

  • Hero Member
  • *****
  • Posts: 1165
    • HowTos Considered Harmful?
Re: Indy example returns Runtime Error (211)
« Reply #4 on: November 20, 2011, 11:20:36 pm »
Afaik one must add a binding using the binding (bindings?) property for all interfaces (0.0.0.0)

This is a Indy9-10 difference.

I think the problem is a Pascal syntax issue rather than a networking issue. The runtime error appears to a problem with virtual implementations, code generation or something related. Although it compiles fine the runtime error appears when the strings have to be copied over.
Lazarus 3.0/FPC 3.2.2

 

TinyPortal © 2005-2018