473,388 Members | 1,383 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,388 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 2986
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.