473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How can a COM ReturnFunction call .NET code?

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

Nov 22 '05 #1
0 579

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: boss | last post by:
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): ...
8
by: ThomasR | last post by:
I understand that virtual methods on inherited objects are slower than non-virtual methods because of the indirection required to support the call. However, when looking at IL code produced by...
0
by: boss | last post by:
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): ...
6
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.