Home All Groups Group Topic Archive Search About

How to specify both <EventClass> and <Guid> Attributes on a class

Author
25 May 2006 7:12 PM
MikeL
What is the syntax for declaring both <EventClass> and <Guid> attributes on
a class? The following causes an error in the class declaration:

Imports System.Runtime.InteropServices
Imports System.EnterpriseServices

    <Guid("0EA77155-29EA-4f1b-870C-B6D7287E65EC")> _
    Public Interface IMyEventClass

    End Interface

' Below is the problem:

    <EventClass()> _
    <Guid("E07B09A3-15C6-400a-BD7E-FDAFEF78BC2C")> _
    Public Class MyEventClass
        Inherits ServicedComponent
        Implements IMyEventClass
    End Class


Thanks in advance,

Mike

Author
25 May 2006 7:32 PM
MikeL
Nevermind, I found the answer:

<EventClass(), _
Guid(".....")> _
Public Class ...

End Class


Show quoteHide quote
"MikeL" <mi***@slomins.com> wrote in message
news:ugE1B9CgGHA.4172@TK2MSFTNGP04.phx.gbl...
> What is the syntax for declaring both <EventClass> and <Guid> attributes
> on a class? The following causes an error in the class declaration:
>
> Imports System.Runtime.InteropServices
> Imports System.EnterpriseServices
>
>    <Guid("0EA77155-29EA-4f1b-870C-B6D7287E65EC")> _
>    Public Interface IMyEventClass
>
>    End Interface
>
> ' Below is the problem:
>
>    <EventClass()> _
>    <Guid("E07B09A3-15C6-400a-BD7E-FDAFEF78BC2C")> _
>    Public Class MyEventClass
>        Inherits ServicedComponent
>        Implements IMyEventClass
>    End Class
>
>
> Thanks in advance,
>
> Mike
>
Author
25 May 2006 10:33 PM
Herfried K. Wagner [MVP]
"MikeL" <mi***@slomins.com> schrieb:
> Nevermind, I found the answer:

Note that the code shown in your original post will compile in VB 2005.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
26 May 2006 7:17 PM
MikeL
Thanks for the tip, Harfried.

Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:uxQDStEgGHA.3900@TK2MSFTNGP05.phx.gbl...
> "MikeL" <mi***@slomins.com> schrieb:
>> Nevermind, I found the answer:
>
> Note that the code shown in your original post will compile in VB 2005.
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>