From: Holysmoke on
Hi,

I have to handle a VB 6.0 ActiveX Dll Generated event in my WPF application.

I tried this following things but it does n't work. Could anyone of help to
resolve this problem. May be pointing out good example of this scenario will
also more helpful.

Created a ActiveX Dll Project in VB 6.0 with a class


Public Event OnConnectedEvent(FromPhoneURI As String)

Public Event OnTerminatedEvent(FromPhoneURI As String)

Public Sub Connect(ByVal FromPhoneURI As String)

RaiseEvent OnConnectedEvent(FromPhoneURI)

End Sub


Public Sub Terminate(ByVal FromPhoneURI As String)

RaiseEvent OnTerminatedEvent(FromPhoneURI)

End Sub


Then Created a VB EXE project for TEST

on a button click I call,

Private m_CCM As New ProjectName.ClassName

Private Sub Command1_Click()


m_CCM.Connect ("9908(a)10.50.32.50")


End Sub

Private Sub Command2_Click()

m_CCM.Terminate ("9908(a)10.50.32.50")

End Sub


On WPF side, I reference this COM object and registered this event


private ProjectName.ClassNameClass myCOMObject = new
ProjectName.ClassNameClass()

public Window1()
{

myCOMObject .OnConnectedEvent +=new
ProjectName.__Totem_OnConnectedEventEventHandler(totem_OnConnectedEvent);
InitializeComponent();

}

public void totem_OnConnectedEvent(ref string FromPhoneURI)
{
MessageBox.Show(FromPhoneURI);
}


and my MessageBOX never shows up.

but I call the myCOMObject.Connect method from WPF the event pops up but I
call the same method from VB EXE never pops up

Please help.

TIA,
Holy

Was this post helpful to you