views:

44

answers:

2

VB 6 can host web pages, which means it can also host Silverlight apps.

Communication from VB 6 to Silverlight can easily be done via URLs. But is there a way for the Silverlight app to send messages back to VB 6?

+1  A: 

You could add a Winsock control to the vb app and get silverlight to talk back to it using WebClient?

Andy Robinson
Last I heard Silverlight cannot talk to other apps on the user's machine. I would have to bouce it back through the web server.
Jonathan Allen
Andy Robinson
+1  A: 

Ok how about this then.. Within the SilverLight app use the HtmlPage class to update the title of the page this can be monitored from the WebBrowser_TitleChange event in vb.

Silverlight code :-

var document = HtmlPage.Document;
document.SetProperty("title","whatever you need");

VB6 code :-

Private Sub WebBrowser_TitleChange(ByVal Text As String)        
    Debug.Print "Title changed to : " & Text        
End Sub

You'd have to ignore the initial TitleChange event when the page loads.

Andy Robinson
You win the prize sir. It's a bit hacky, but it will certainly do the job.
Jonathan Allen