Problem with RaiseEvent()

F

ffa

In a class called Client I have an event called RefreshData (Public Event
Refresh) which is fired whenever the Client class does a data fetch.

In the main form I declare: Private WithEvents oClient As New Client(dbName)

For some reason the method "oClient_RefreshData() Handles
oClient.RefreshData" no longer fires.

Anyone have any ideas why this is occurring? In fact I have three class
similar to this and they have all stopped firing as well. I only use the
RefreshData Event for enabling some menu items. All normal controls are
bound.

VB 2005 - 130k lines of code
 
P

Phill W.

In a class called Client I have an event called RefreshData (Public Event
Refresh) which is fired whenever the Client class does a data fetch.

So /which/ is it?

Class Client
Public Event Refresh

or

Class Client
Public Event RefreshData

??

Does your OnRefresh method get called? (You /do/ have one, don't you?)

Class Client
Public Event Refresh( sender as Object, e as EventArgs )

Protected Sub OnRefresh()
RaiseEvent Refresh( Me, EventArgs.Empty )
End Sub

End Class

HTH,
Phill W.
 
F

ffa

Hi Phil
Thank you for your patronising comments. Consider me suitably repremanded. I
do admire how you managed to completly avoid any form of answer or positive
suggestion. Please find further comments inline:


Oh dear, a typo, that should have said RefreshData. My profuse apologies.
How could I have been so abundantly stupid.
So /which/ is it?

Class Client
Public Event Refresh

or

Class Client
Public Event RefreshData

??

Does your OnRefresh method get called? (You /do/ have one, don't you?)

Of course it does
 
A

Armin Zingler

Hi Phil
Thank you for your patronising comments. Consider me suitably
repremanded. I do admire how you managed to completly avoid any form
of answer or positive suggestion. Please find further comments
inline:

No need to feel offended. There was nothing wrong with what Phill said, and
how.


Armin
 
F

ffa

Armin Zingler said:
No need to feel offended. There was nothing wrong with what Phill said,
and how.


Armin
Problem with being an international forum is that most of us are unaware of
conventions and semantics in countries other than our own. All the guys in
my department thought the reply to be offensive.
Perhaps the fault is ours and we are oversensitive. However, any employee in
our company that replies to a genuine message in the manner that Phil did,
would be reprimanded by management.
 
A

Armin Zingler

Problem with being an international forum is that most of us are
unaware of conventions and semantics in countries other than our
own. All the guys in my department thought the reply to be
offensive.
Perhaps the fault is ours and we are oversensitive. However, any
employee in our company that replies to a genuine message in the
manner that Phil did, would be reprimanded by management.

I'm just not aware of which part of his answer was offensive. Maybe I don't
see it because I'm not a native English speaker. In general, you can not
expect an answer like being a customer of a company calling it's support.
This is a users-help-users forum, so you (usually) don't get support from
MSFT here. From MSFT, AFAIK, you can pay for a kind of support (don't know
how it is called) to get answers to your questions in the MSFT newsgroups.
Then you will get a reply that will probably satisfy your claims in a more
appropriate way. You didn't get a "RTFM", BTW.


Armin
 
R

rowe_newsgroups

Problem with being an international forum is that most of us are unaware of
conventions and semantics in countries other than our own. All the guys in
my department thought the reply to be offensive.
Perhaps the fault is ours and we are oversensitive. However, any employee in
our company that replies to a genuine message in the manner that Phil did,
would be reprimanded by management.

I'd hate to say it, but I don't see how Phill's response was offensive
either, remember on the internet you must take things in the best
possible way, as written words are much harder to show emotional
context cues. I will offer you a few words of advice though, since
technical newsgroups act a bit different than most things:

First, unless you see a [MSFT] after our name, none of us are paid to
be here, we all volunteer. Being volunteers, we expect people to
present their problems in a way that makes it easy for us to look at
and solve. For example many "newbies" post complain that there code is
throwing an exceptions, but don't list the code or the exception.
Similarly, your post mentioned you had an "event called RefreshData
(Public Event Refresh)" which due to a typo made a very confusing
post. My approach was to ignore your post (I don't spend time on what
I can't understand). Phill's approach was to ask for clarification of
the post.

Second, if you don't say you aren't a new programmer, we will probably
treat you like one until we know otherwise. In other words, don't feel
bad if we talk to you like a beginner programmer, it's not an insult,
it's a precaution on our end to prevent mass confusion if the OP is un-
knowledgeable.

Third, never, ever reply rudely to a post, even if the original post
was found rude. In worst cases this will lead to a flame war,
something you don't want to participate in. In other cases (like
replying harshly to a regular) it cause your post be ignored by other
regulars and not get answered (or land you in a kill file if you were
very mean). Either way, a harsh reply to a lingual misunderstanding
(if that's what it was) is not worth getting yourself ignored.

Also, if you remove all the cursed (imo) "Handles ...." lines from
your class and just use AddHandler in the class constructor to wire up
the events will everything work?

Thanks,

Seth Rowe
 

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