471,328 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,328 software developers and data experts.

'WithEvents' Variables cannot be typed as Arrays

Hi you Gurus,

I would like your help with my 'challenge' ;-) Any help or advice would be
greatly appriciated!!

I've created a Class wich retrieves FTP files.
In that Class there are several events telling me the filetransfer succeeded
or Failed. I have to get a hole range of files so making it serial would take
a lot of time. (BTW MGET commands doesn't work for me) So i would like to
start multiple gets at the same time and at the same time control the maximum
connections.

So i thought lets make a Array of the classes and each time the event fired
that a file is succesfully recieved make the Class get the next file.

Public Withevents objFTP() as new FTP

But VB.NET does not agree with me and gives me the following error:
'WithEvents' Variables cannot be typed as Arrays

This maybe a easy task for you to solve...
And maybe the answer is so obvious, but i'm stuck now, so any advice as i
said earlier would be gratly appriciated!

Thanks in Advance!

Rob Smeets
Jul 21 '05 #1
1 2838
See "AddHandler" to add your event handlers by code...

I never llok the IL for this but it's likely that the dynamic nature of
arrays make more difficult for the compiler to create the appropriate code
for handling automatically these events...

--

"Rob Smeets" <Ro*******@discussions.microsoft.com> a écrit dans le message
de news:A3**********************************@microsof t.com...
Hi you Gurus,

I would like your help with my 'challenge' ;-) Any help or advice would be
greatly appriciated!!

I've created a Class wich retrieves FTP files.
In that Class there are several events telling me the filetransfer succeeded or Failed. I have to get a hole range of files so making it serial would take a lot of time. (BTW MGET commands doesn't work for me) So i would like to
start multiple gets at the same time and at the same time control the maximum connections.

So i thought lets make a Array of the classes and each time the event fired that a file is succesfully recieved make the Class get the next file.

Public Withevents objFTP() as new FTP

But VB.NET does not agree with me and gives me the following error:
'WithEvents' Variables cannot be typed as Arrays

This maybe a easy task for you to solve...
And maybe the answer is so obvious, but i'm stuck now, so any advice as i
said earlier would be gratly appriciated!

Thanks in Advance!

Rob Smeets

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Ayaz Ahmed Khan | last post: by
4 posts views Thread by Brian Lowe | last post: by
6 posts views Thread by | last post: by
8 posts views Thread by Bob Day | last post: by
1 post views Thread by Joel Whitehouse | last post: by
58 posts views Thread by Jorge Peixoto de Morais Neto | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.