The form doesn't block or wait in a loop, it responds to commands.Quote
After the web page is downloaded a webbrowser0.downloadcomplete event fires and I can write code to respond.
So the problem is solved ?
I still think it is not more complex in .NET/C#:
Code Select
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WebCrawlerWithNewLisp
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
[DllImport("newlisp.dll", EntryPoint="newlispEvalStr",CharSet = CharSet.Ansi)]
public extern static string newlispEvalStr(string cmd);
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void Button1Click(object sender, EventArgs e)
{
webBrowser1.Url = new System.Uri(textBox1.Text);
webBrowser1.Update();
}
void WebBrowser1DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
// this will be called on completion !
MessageBox.Show(newlispEvalStr(@"(println ""Hello from Newlisp - embedded in C# !"")"),"Loading completed");
}
}
}
The VB.NET code would look really a lot like this.