Need to host a subversion repository? Try our hosted development tools.

VB.NET

Moderators: seancampbell
Number of threads: 3618
Number of posts: 9200

This Forum Only
Post New Thread

Report
vb6 handles .net com class event Posted by blachogi on 13 Nov 2009 at 8:08 AM
i have the ComClassSearchCustomers class and interface IComClassSearchCustomersat .net which used to create a tlb file. The class raise an event inside new. After that i have a vb6 form Form1 which catch the event , but it never see the event. Any ideas?
Option Strict On
Option Explicit On
Imports System.Runtime.InteropServices

<Guid("BB86EB1C-6444-424f-B83B-A667561E06C3"), _
ComSourceInterfaces(GetType(IComClassSearchCustomers))> _
Public Class ComClassSearchCustomers

Public Delegate Sub printReportEventHandler(ByVal codes As String)
Public Event printReport As printReportEventHandler

Public Sub New()
MyBase.New()
RaiseEvent printReport(“MARIA”)
End Sub
End Class


Imports System.Runtime.InteropServices

<Guid("D8F7EC74-0EFC-4e43-9B59-4CF741DF616D"), _
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface IComClassSearchCustomers
<DispId(1)> _
Sub printReport(ByVal codes As String)
End Interface
Public WithEvents Instance As Search.ComClassSearchCustomers

Private Sub Form_Load()
Set Instance = New Search.ComClassSearchCustomers
End Sub

Private Sub Instance_printReport(ByVal codes As String)
MsgBox ("raise")
End Sub





 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A bootstrapLabs project.