473,221 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 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 2973
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jakob Bengtsson | last post by:
Hi, I have a form (which cannot be serialized). In the form's code I declare an object like this (never mind the object nor class name, it's for illustration only): Private WithEvents...
13
by: Ayaz Ahmed Khan | last post by:
Can a variable containing, say, an integer value be used as size declarator for an array of integers? g++ does not complain, but other compilers, such as Visual C++/6.0, Borland Builder C++, Turbo...
19
by: Canonical Latin | last post by:
"Leor Zolman" <leor@bdsoft.com> wrote > "Canonical Latin" <javaplus@hotmail.com> wrote: > > > ... > >But I'm still curious as to the rational of having type >...
4
by: Brian Lowe | last post by:
I have several aspx pages that include a couple of asp:placeholder controls, an example is myPage.aspx. The page inherits from a custom class 'myClass' which inherits System.Web.UI.Page which...
6
by: | last post by:
Is there any additional overhead for declaring a variable using the WithEvents keyword even if none of the events are being handled?
8
by: Bob Day | last post by:
Using VS 2003, VB.NET, MSDE If an event is raised in a class that was NOT instantiated with the WithEvents key word, is that event effectively ignored? Or, another way to phrase the question,...
1
by: Rob Smeets | last post by:
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...
1
by: Joel Whitehouse | last post by:
Is there any way I can get the effects of declaring objects using WithEvents while also having indexed addressing? I'm designing a control that has several buttons, the functions of which vary...
58
by: Jorge Peixoto de Morais Neto | last post by:
I was reading the code of FFmpeg and it seems that they use malloc just too much. The problems and dangers of malloc are widely known. Malloc also has some overhead (although I don't know what is...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.