S
Sergey Poberezovskiy
I have the following code in C# that I have trouble converting to VB(2.0):
private delegate void openDialog();
private void openWindowsDialog(openDialog open)
{
Thread thread = new Thread(new ThreadStart(open));
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
I tried the following code, but it would not compile:
Private Delegate Sub openDialog()
Private Sub openWindowsDialog(ByVal open As openDialog)
Dim thread As Thread = New Thread(New ThreadStart(open)) ' exception
here: Error 2 'System.Threading.ThreadStart' is a delegate type and requires
a single 'addressof' expression as the only argument to the constructor.
thread.SetApartmentState(ApartmentState.STA)
thread.Start()
End Sub
Thanks in advance for any help.
private delegate void openDialog();
private void openWindowsDialog(openDialog open)
{
Thread thread = new Thread(new ThreadStart(open));
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
I tried the following code, but it would not compile:
Private Delegate Sub openDialog()
Private Sub openWindowsDialog(ByVal open As openDialog)
Dim thread As Thread = New Thread(New ThreadStart(open)) ' exception
here: Error 2 'System.Threading.ThreadStart' is a delegate type and requires
a single 'addressof' expression as the only argument to the constructor.
thread.SetApartmentState(ApartmentState.STA)
thread.Start()
End Sub
Thanks in advance for any help.