Control.Invoke and ByRef args

S

swartzbill2000

Hello,
I wish to use Control.Invoke to make an inter-thread call to a sub that
has ByRef args. How can I pass the ByRef args? Syntax like
New Object() {byRefArg1, byRefArg2}
in fact passes by value.
Bill
 
A

Armin Zingler

Hello,
I wish to use Control.Invoke to make an inter-thread call to a sub
that has ByRef args. How can I pass the ByRef args? Syntax like
New Object() {byRefArg1, byRefArg2}
in fact passes by value.
Bill

You destroy the return values because you create a temporar array that you
can not access after Invoke returns.


dim o as object()

o = new object(){byRefArg1, byRefArg2}
'invoke here
'Access o(0) and o(1) here



Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top