Hello all!
To communicate with a (closed source) application this
application offers COM objects for interaction. In
JavaScript this works like this (just for understanding
of my question):
############## JAVASCRIPT ##################
function connSetup(msg,path)
{
oBERT.OnConnectionSetup(msg,pa*th)
}
// Reserve COM connection variable
var oBERT
var oNHS
// Open COM connection
oBERT = new ActiveXObject("NetHawk.BERT")
oNHS = new ActiveXObject("NetHawk.RNCIub"*)
var sOptional=""
function Startup()
{
oNHS.NHSAPISetSignal(connSetup*, "/rrc/generic_conn_setup",
sOptional);
}
############## END OF JAVASCRIPT ##################
The first paramter of this NHSAPISetSignal function is a
Returnfunction to this connSetup function.
I have to achive this within a .NET assembly. In VB.NET I have
tried to use a Delegate as a paramter for this Return function like:
############## VB.NET ##################
Public Delegate Sub ConnSetupDelegate(ByVal Msg As Object, ByVal Path
As Object)
Public Sub ConnSetup(ByVal Msg As Object, ByVal Path As Object)
Debug.WriteLine("ConnSetup was called! with Parameters: " & Msg
& ", "
& Path & vbCrLf)
oBERT.OnConnectionSetup(msg,pa*th)
End Sub
Public Sub Start()
Dim conn As ConnSetupDelegate
conn = AddressOf ConnSetup
Dim sOptional as String = ""
oBert = CreateObject("NetHawk.BERT")
oNHS = CreateObject("NetHawk.RNCIub")
oNHS.NHSAPISetSignal(conn, "/rrc/generic_conn_setup",
sOptional)
End Sub
############## END OF VB.NET ##################
But this does not work!! (ConnSetup was never called.)
So my question: How can I achieve this Eventhandler in VB.NET or
what is necessary that this COM Object (oNHS) gets this
ReturnFunction???
Any hint is welcome + Thanks in advance!
Markus