Welcome Guest Search | Active Topics | Sign In | Register

Getting synchronous result back from VB Options
Pouya
Posted: Monday, August 3, 2015 12:24:11 PM
Rank: Newbie
Groups: Member

Joined: 8/3/2015
Posts: 3
Hi Guys,

just purchased the EO Web browser product and just getting my head around it all..

question about getting a synchronous string back from vb.net

eg:
javascript requests a list of printer names from vb.net
VB gets request, creates a string and sends it back
When received back in javascript, the result is “null”

javascript call:
var result = eoWebBrowser.extInvoke("getPrinters", "")


Vb.net
Public Function WebView_JSExtInvoke(sender As Object, e As JSExtInvokeArgs) As String
If e.FunctionName = "getPrinters" Then
Dim printers As String = getPrinterNames()

Return printers
End If

End Function

the plumbing all works fine, just the result comes back as "null"
I'm hoping it all makes sense and someone can help me out..

many thanks,
Pouya

eo_support
Posted: Monday, August 3, 2015 2:41:17 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Hi,

You would return value to the JavaScript by setting e.ReturnValue in your event handler, not by returning a value from your event handler function.

Thanks!
Pouya
Posted: Monday, August 3, 2015 9:44:37 PM
Rank: Newbie
Groups: Member

Joined: 8/3/2015
Posts: 3
Perfect - thank you!
eo_support
Posted: Tuesday, August 4, 2015 9:27:11 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
You are welcome. Please feel free to let us know if there is anything else.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.