Custom Component

  • Thread starter Thread starter Fred Chen
  • Start date Start date
F

Fred Chen

Hi,

I've create a custom component using C#. This component works fine in
a C# project. When I add the component to a VB project I get the
compile error,

"'WithEvents' variable does not raise any events"

Is there a way to add this component to a VB project without it
automatically adding the WithEvents keyword before the variable name?

Fred
 
Unfortunately, there is no way to not add the "WithEvents" keyword unless
you change the CodeDomSerializer for your component.
However, your component supports the Disposed event, correct? Do you get
this error if you create your component as a desktop component and
reference it from a desktop VB project?

-Ben

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: (e-mail address removed) (Fred Chen)
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: Custom Component
| Date: 14 Aug 2003 10:36:26 -0700
| Organization: http://groups.google.com/
| Lines: 12
| Message-ID: <[email protected]>
| NNTP-Posting-Host: 199.93.176.11
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1060882588 29341 127.0.0.1 (14 Aug 2003
17:36:28 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: 14 Aug 2003 17:36:28 GMT
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfee
d01.sul.t-online.de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!sn-xi
t-02!sn-xit-06!sn-xit-09!supernews.com!postnews1.google.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:31009
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi,
|
| I've create a custom component using C#. This component works fine in
| a C# project. When I add the component to a VB project I get the
| compile error,
|
| "'WithEvents' variable does not raise any events"
|
| Is there a way to add this component to a VB project without it
| automatically adding the WithEvents keyword before the variable name?
|
| Fred
|
 
Hi Ben,

Thanks for you reply.

Yes, my component does work if I use it on my desktop, but I need it to
work for my Smart Device.

Fred
 
Are you sure you are using the released version of Visual Studio? We had
this problem in an early beta, but we fixed it. there should be a
"Disposed" event on your base class System.ComponentModel.Component -- so
"WithEvents" is valid and should be what you are seeing on the desktop
designer as well.
If you still have this problem, please send me your component and I will
see what I can do.

-Ben

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: Fred Chen <[email protected]>
| References: <[email protected]>
| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: RE: Custom Component
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| Message-ID: <#2TJl2#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Date: Thu, 21 Aug 2003 07:08:05 -0700
| NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:31583
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi Ben,
|
| Thanks for you reply.
|
| Yes, my component does work if I use it on my desktop, but I need it to
| work for my Smart Device.
|
| Fred
|
|
| Don't just participate in USENET...get rewarded for it!
|
 
Back
Top