By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,288 Members | 1,695 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,288 IT Pros & Developers. It's quick & easy.

Problem with RaiseEvent()

P: n/a
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
Sep 24 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
ff*@newsgroup.nospam wrote:
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.
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

Sep 24 '07 #2

P: n/a
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:

"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kwrote in message
news:fd**********@south.jnrs.ja.net...
ff*@newsgroup.nospam wrote:
>In a class called Client I have an event called RefreshData (Public Event
RefreshData) which is called whenever the Client class does a data fetch.
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
>
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.
>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

Sep 24 '07 #3

P: n/a
"ff*@newsgroup.nospam" <ha**********@ffapaysmart.com.auschrieb
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

Sep 24 '07 #4

P: n/a
ffa

"Armin Zingler" <az*******@freenet.dewrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"ff*@newsgroup.nospam" <ha**********@ffapaysmart.com.auschrieb
>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
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.
Sep 25 '07 #5

P: n/a
"ff*@newsgroup.nospam" <ha**********@ffapaysmart.com.auschrieb
>
"Armin Zingler" <az*******@freenet.dewrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"ff*@newsgroup.nospam" <ha**********@ffapaysmart.com.auschrieb
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
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

Sep 25 '07 #6

P: n/a
On Sep 24, 10:38 pm, "f...@newsgroup.nospam"
<harry_NOS...@ffapaysmart.com.auwrote:
"Armin Zingler" <az.nos...@freenet.dewrote in message

news:%2****************@TK2MSFTNGP05.phx.gbl..."f. ..@newsgroup.nospam" <harry_NOS...@ffapaysmart.com.auschrieb
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

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

Sep 25 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.