Click here to Skip to main content
15,920,383 members
Home / Discussions / COM
   

COM

 
GeneralRe: How to interface a COM class in a non-COM DLL Pin
morenz1-Aug-05 12:42
morenz1-Aug-05 12:42 
QuestionHow to access COM enums from JScript Pin
kozu29-Jul-05 11:35
kozu29-Jul-05 11:35 
QuestionHow to make DCOM work over VPN ? Pin
vgrigor129-Jul-05 4:40
vgrigor129-Jul-05 4:40 
Questionhow to create COM DLL ..Help Me Pin
Anonymous29-Jul-05 1:18
Anonymous29-Jul-05 1:18 
AnswerRe: how to create COM DLL ..Help Me Pin
vgrigor129-Jul-05 4:48
vgrigor129-Jul-05 4:48 
AnswerRe: how to create COM DLL ..Help Me Pin
Logan from Singapore31-Jul-05 16:12
Logan from Singapore31-Jul-05 16:12 
Questionhow to create DLL ..Help Me Pin
Anonymous29-Jul-05 1:17
Anonymous29-Jul-05 1:17 
GeneralCOM Interop event handling - help! Pin
Will-FG28-Jul-05 23:50
Will-FG28-Jul-05 23:50 
I am using a .NET library from VB6 using COM interop. Functions / subs etc. can be called from the VB6 code and work as expected. However, I want to get VB6 to handle events generated in the VB.NET code. When I declare the library as "withevents", I get this error:

Runtime Error 459

Object or class does not support the set of events


The code is below, sorry if it is not that clear - the issue is the first few declarations etc. - the sink interface does not seem to connect to the class!!!

Imports System.Runtime.InteropServices
Imports CommsModulePC

', GuidAttribute("{ECB60CBD-42D7-4a93-9DB7-E6F4F0FEE3BA}")> _
'Public Event CommandReceived(ByVal theCommand As DeskCommands, ByVal args As String)
Public Delegate Sub CommandReceivedDelegate(ByVal theCommand As DeskCommands, ByVal args As String)

' Step 1: Defines an event sink interface (ButtonEvents) to be
' implemented by the COM sink.
<guidattribute("1a585c4d-3371-48dc-af8a-affecc1b0967"), _
interfacetypeattribute(cominterfacetype.interfaceisidispatch)=""> _
Public Interface CommandEvents
Sub CommandReceivedDelegate(ByVal theCommand As DeskCommands, ByVal args As String)
End Interface

' Step 2: Connects the event sink interface to a class
' by passing the namespace and event sink interface
' ("EventSource.ButtonEvents, EventSrc").
'ClassInterface(ClassInterfaceType.AutoDual),
'<comsourceinterfaces("hwmoduleplugin.commandevents, hwmoduleplugin")=""> _

<comsourceinterfaces(gettype(commandevents))> _
Public Class PluginOwner
Public Event CommandReceived As CommandReceivedDelegate
Dim WithEvents theCommsOwner As CommsOwner

Public Function Startup(ByVal theIP As String, ByVal thePort As Int16)
theCommsOwner = New CommsOwner(theIP, thePort)
theCommsOwner.Startup()
End Function

Public Property target() As String
Get
Return theCommsOwner.ToEndPoint.Address.ToString
End Get
Set(ByVal Value As String)
theCommsOwner.ToEndPoint.Address.Parse(Value)
End Set
End Property

Public Sub Connect() 'note that CommsOwner just assumes it has connected! change handshake routine!
If Not theCommsOwner.GetConnectionStatus Then theCommsOwner.Connect()
End Sub

Public Sub DisConnect()
If theCommsOwner.GetConnectionStatus Then theCommsOwner.Disconnect()
End Sub

Public Sub Shutdown()
If theCommsOwner.GetConnectionStatus Then theCommsOwner.Disconnect()
theCommsOwner.Shutdown()
End Sub

Public Sub triggereventtest()
MsgBox("trigger called")
RaiseEvent CommandReceived(DeskCommands.nmCmdAxis, "test")
End Sub

Private Sub theCommsOwner_NewData1(ByVal type As CommsModulePC.MessageTypes, ByRef mBody As String) Handles theCommsOwner.NewData
'ListBox1.Items.Insert(0, "REC " & mBody)
Dim resultarraylist As ArrayList
resultarraylist = ParseTokens(mBody)
Dim todo As DoList

Select Case type
Case MessageTypes.COMMAND
For Each todo In resultarraylist
RaiseEvent CommandReceived(System.Enum.GetName(GetType(DeskCommands), todo.Ident), todo.args)
'ListBox1.Items.Insert(0, System.Enum.GetName(GetType(DeskCommands), todo.Ident) & ": " & todo.args)
Next
'send some commands on
Case MessageTypes.DATA
For Each todo In resultarraylist
'ListBox1.Items.Insert(0, System.Enum.GetName(GetType(KETOPDataOutputs), todo.Ident) & ": " & todo.args)
Next
'send some data on
Case Else
'ListBox1.Items.Insert(0, "Some other stuff has arrived")
End Select
End Sub
End Class
GeneralLoading ActiveX under Limitted User Account Pin
MohammadAmiry28-Jul-05 7:32
MohammadAmiry28-Jul-05 7:32 
GeneralRe: Loading ActiveX under Limitted User Account Pin
vishalmore29-Jul-05 21:49
vishalmore29-Jul-05 21:49 
GeneralCall a running C# application from a C++ application Pin
scchan198427-Jul-05 22:02
scchan198427-Jul-05 22:02 
GeneralRe: Call a running C# application from a C++ application Pin
Lim Bio Liong29-Jul-05 2:54
Lim Bio Liong29-Jul-05 2:54 
GeneralRe: Call a running C# application from a C++ application Pin
Lim Bio Liong29-Jul-05 11:04
Lim Bio Liong29-Jul-05 11:04 
Questionhow to connect modem to CPU by using visual basic Pin
Member 214288927-Jul-05 20:26
Member 214288927-Jul-05 20:26 
GeneralOutlook 2003 COM AddIn Pin
civilwar27-Jul-05 4:04
civilwar27-Jul-05 4:04 
GeneralHelp!!!!! Need to do COM DLL with multiple objects Pin
Logan from Singapore27-Jul-05 0:37
Logan from Singapore27-Jul-05 0:37 
GeneralRe: Help!!!!! Need to do COM DLL with multiple objects Pin
Jörgen Sigvardsson27-Jul-05 3:03
Jörgen Sigvardsson27-Jul-05 3:03 
GeneralRe: Help!!!!! Need to do COM DLL with multiple objects Pin
Logan from Singapore27-Jul-05 15:18
Logan from Singapore27-Jul-05 15:18 
GeneralRe: Help!!!!! Need to do COM DLL with multiple objects Pin
Jörgen Sigvardsson27-Jul-05 15:25
Jörgen Sigvardsson27-Jul-05 15:25 
GeneralRe: Help!!!!! Need to do COM DLL with multiple objects Pin
Jörgen Sigvardsson27-Jul-05 15:28
Jörgen Sigvardsson27-Jul-05 15:28 
GeneralRe: Help!!!!! Need to do COM DLL with multiple objects Pin
Logan from Singapore27-Jul-05 15:41
Logan from Singapore27-Jul-05 15:41 
GeneralMessage handler EM_GETLINE prob... Pin
chettu26-Jul-05 7:07
chettu26-Jul-05 7:07 
General0Setting Launch Permissions Programmatically for a DCOM Component Pin
Muhammad Kamran26-Jul-05 3:22
Muhammad Kamran26-Jul-05 3:22 
GeneralActiveX in VB.NET web app Pin
Spaz8024-Jul-05 23:58
Spaz8024-Jul-05 23:58 
GeneralRe: ActiveX in VB.NET web app Pin
vishalmore29-Jul-05 21:54
vishalmore29-Jul-05 21:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.