Re: firing events from server

"Knebels, Francis" <[email protected]> Tue, 28 May 2002 13:16:05 -0400
Newsgroups gmane.comp.windows.devel.vbcom
Message-ID <[email protected]>
this is a specific problem with object creation in the _NodeClick event and
firing custom events.  The objects are setup correctly because if I change
the object creation to form_load, it all works properly.  The variable is
defined with "WithEvents" in the declaration section of a form.  I read the
other post by Tinh and my project conforms to all the rules in his post.  I
really believe that it has something to do with the treeview somehow.

Francis X. Knebels
Merck Vaccine Division
WP97-3W507
215.652.7710


-----Original Message-----
From: Mark Burns [mailto:[email protected]]
Sent: Tuesday, May 28, 2002 12:05 PM
To: [email protected]
Subject: Re: [VBCOM] firing events from server


Francis,

Are you using the remote COM object, within a class or within a VB
module?
In order to process events from a remote com object it must be declared
WithEvents in a class module within your project.

Unless I'm misunderstanding what you are asking, check out the VB online
help for the WithEvents keyword.
Like:

==== in a class module within your project ====
Dim Withevents X as myComServerEventGenerationObject

Private Sub/Function X_WhateverTheEventNameIsFromYourCOMServerObject()
  <event handling code here>
End Sub/Function

Regards,
- Mark
Harrison Career Institute, Inc.
Voorhees, NJ
(856) 751-8181 x118

> -----Original Message-----
> From: VBCOM [mailto:[email protected]] On Behalf Of
> Knebels, Francis
> Sent: Tuesday, May 28, 2002 10:23 AM
> To: [email protected]
> Subject: [VBCOM] firing events from server
>
>
> Has anyone run into a problem firing events from COM
> components.  Here's my scenario.
>
> I have a COM server that fires an event.  I have a standard
> EXE that should catch the event.  the standard EXE has a
> treeview control and I create an instance of the COM server
> in the NodeClick event of the treeview.  Events from this
> object instance are never fired up to the client.  If I take
> the object creation out of the NodeClick and put it in the
> Form_load event, everything works properly.  Is this a known
> issue?  I searched the MSKB but didn't find anything.
>
> Francis X. Knebels
> Merck Vaccine Division
> WP97-3W507
> 215.652.7710
>
>
> --------------------------------------------------------------
> ----------------
> Notice: This e-mail message, together with any attachments,
> contains information of Merck & Co., Inc. (Whitehouse
> Station, New Jersey, USA) that may be confidential,
> proprietary copyrighted and/or legally privileged, and is
> intended solely for the use of the individual or entity named
> on this message. If you are not the intended recipient, and
> have received this message in error, please immediately
> return this by e-mail and then delete it.
>
> ==============================================================
> ================
>
> You can read messages from the VBCOM archive, unsubscribe
> from VBCOM, or subscribe to other DevelopMentor lists at
> http://discuss.develop.com.
>
>

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.

==============================================================================

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.