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

COM Interop

P: n/a
Boy, bet I'm being a pest now... Well, got the COM interop working, or so I
though. Here's the .NET code in the DLL...

<ComClass(Rythmia.ClassID, Rythmia.InterfaceId, Rythmia.EventsId)> _
Public Class Rythmia
#Region "COM Class IDs"
Public Const ClassID As String = "5F0D4112-B23D-4703-94F5-B5B96E50F3BB"
Public Const InterfaceId As String = "A9DFEE4E-3DBB-4505-BBC6-9BCEE5A220A5"
Public Const EventsId As String = "E6CAB551-4A34-4c4d-83EA-7D3D7E2E49DF"
#End Region
#Region "Events"
Public Event Progress(ByVal Value As Long, ByVal Maximum As Long)
Public Event Status(ByVal StatusMessage As String)
#End Region

Now, in VB6, after I referenced it, I used this:
Private WithEvents Ency As DGRE.Rythmia

Private Sub Form_Load()
Set Ency = New DGRE.Rythmia
End Sub

And I get this when I try to select an Event:
"Function or Interface is marked as restricted, or the function uses an
Automation Type not supported in Visual Basic"

Am I doing something wrong?

Tibby
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Tibby" <ti*************@hotmail.com> wrote in message
news:OK**************@tk2msftngp13.phx.gbl...
Boy, bet I'm being a pest now... Well, got the COM interop working, or so I though. Here's the .NET code in the DLL...

<ComClass(Rythmia.ClassID, Rythmia.InterfaceId, Rythmia.EventsId)> _
Public Class Rythmia
#Region "COM Class IDs"
Public Const ClassID As String = "5F0D4112-B23D-4703-94F5-B5B96E50F3BB"
Public Const InterfaceId As String = "A9DFEE4E-3DBB-4505-BBC6-9BCEE5A220A5" Public Const EventsId As String = "E6CAB551-4A34-4c4d-83EA-7D3D7E2E49DF"
#End Region
#Region "Events"
Public Event Progress(ByVal Value As Long, ByVal Maximum As Long)
Public Event Status(ByVal StatusMessage As String)
#End Region

Now, in VB6, after I referenced it, I used this:
Private WithEvents Ency As DGRE.Rythmia

Private Sub Form_Load()
Set Ency = New DGRE.Rythmia
End Sub

And I get this when I try to select an Event:
"Function or Interface is marked as restricted, or the function uses an
Automation Type not supported in Visual Basic"


Long in VB.NET is a 64 bit signed integer. VB6 has no corresponding type.
Long in VB6 is the same type as Integer in VB.NET.

So change your Progress event to use Integer instead of Long.

David
Nov 20 '05 #2

P: n/a
Someone got a big hand I can smack myself with. Jeez LMAO

Thanks again David
Tibby

"David Browne" <davidbaxterbrowne no potted me**@hotmail.com> wrote in
message news:Of*************@TK2MSFTNGP11.phx.gbl...

"Tibby" <ti*************@hotmail.com> wrote in message
news:OK**************@tk2msftngp13.phx.gbl...
Boy, bet I'm being a pest now... Well, got the COM interop working, or
so I
though. Here's the .NET code in the DLL...

<ComClass(Rythmia.ClassID, Rythmia.InterfaceId, Rythmia.EventsId)> _
Public Class Rythmia
#Region "COM Class IDs"
Public Const ClassID As String = "5F0D4112-B23D-4703-94F5-B5B96E50F3BB"
Public Const InterfaceId As String =

"A9DFEE4E-3DBB-4505-BBC6-9BCEE5A220A5"
Public Const EventsId As String = "E6CAB551-4A34-4c4d-83EA-7D3D7E2E49DF"
#End Region
#Region "Events"
Public Event Progress(ByVal Value As Long, ByVal Maximum As Long)
Public Event Status(ByVal StatusMessage As String)
#End Region

Now, in VB6, after I referenced it, I used this:
Private WithEvents Ency As DGRE.Rythmia

Private Sub Form_Load()
Set Ency = New DGRE.Rythmia
End Sub

And I get this when I try to select an Event:
"Function or Interface is marked as restricted, or the function uses an
Automation Type not supported in Visual Basic"


Long in VB.NET is a 64 bit signed integer. VB6 has no corresponding type.
Long in VB6 is the same type as Integer in VB.NET.

So change your Progress event to use Integer instead of Long.

David

Nov 20 '05 #3

P: n/a
Hi Libby,

LOL.

Sometimes it's the big things. Sometimes it's the little things.

And sometimes it's the big things that used to be little things!! ;-)

Regards,
Fergus
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.