gabr42 / gabr42/OmniThreadLibrary

ForEach not working for objects?

Open
#176 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Pascal
Stars
513
Forks
147
PR merge metrics
No merged PRs in 30d

Description

I have a TListView and I'm doing this to iterate over the Items in it:

```
FWorker := Parallel.ForEach( lview1.Items );

FWorker.Execute(
procedure( const task: IOmniTask; const aLI : TListItem )
begin
. . . .
```
I get this error:

First chance exception at $75CBB5B2. Exception class Exception with message 'TValue of type tkClass cannot be converted to TOmniValue'. Process ThreadingTest2VCL.exe (8516)

in procedure OtlCommon.TOmniValue.SetAsTValue(const value: TValue);

If I change it to a pointer, that fails as well, I'm guessing because the iterator returns an object.

Is this a bug, or "as designed"?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.