Handling ActiveX DLL Event in C#

H

Holysmoke

Hi,

I have to handle a VB 6.0 Application 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 PhoneticaCCM.Totem
Private Sub Command1_Click()


m_CCM.Connect ("[email protected]")


End Sub

Private Sub Command2_Click()

m_CCM.Terminate ("[email protected]")

End Sub


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


private PhoneticaCCM.TotemClass myCOMObject = new
PhoneticaCCM.TotemClass();

public Window1()
{

myCOMObject .OnTotemConnectedEvent +=new
PhoneticaCCM.__Totem_OnTotemConnectedEventEventHandler(totem_OnTotemConnectedEvent);
InitializeComponent();

}

public void totem_OnTotemConnectedEvent(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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top