Nicoulas, thanks for the quick reply!
C# Code:
[ComVisible(true )]
[ProgId("SYSteam .LogonBox")]
[ClassInterface( ClassInterfaceT ype.AutoDual)]
public class MainClass
{
LogonBox logonBox;
public MainClass()
{
logonBox = null;
}
public void Show()
{
string userName;
string userDomain;
string logonServer;
string serverName;
logonBox = new LogonBox();
userName = System.Environm ent.GetEnvironm entVariable("US ERNAME");
userDomain =
System.Environm ent.GetEnvironm entVariable("US ERDOMAIN");
logonServer =
System.Environm ent.GetEnvironm entVariable("LO GONSERVER");
serverName =
System.Environm ent.GetEnvironm entVariable("CO MPUTERNAME");
logonBox.SetInf o(serverName, logonServer, userDomain + @"\" +
userName);
logonBox.Show() ;
}
VBScript Code:
Dim objLogonBox
Set objLogonBox = CreateObject("S YSteam.LogonBox ")
objLogonBox.Sho w()
objLogonBox.add line("Welcome to the domain...")
It's really sucha simple app and I can't understand the performance issue in
this.
The form is displayed and you'll see each control on the form beeing drawn.
Thanks in advance.
BR,
Jonas
"Nicholas Paldino [.NET/C# MVP]" wrote:
Jonas,
Can you post an example of the script and the code you used to compile
the assembly? Part of it could be to start up the CLR in the process (you
are doing COM interop after all).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Drwtsn32" <Dr******@discu ssions.microsof t.com> wrote in message
news:3F******** *************** ***********@mic rosoft.com... Hi Guys,
I'm ripping off all of my hair soon ;-)
I'm trying to do a very simple C# form accessible from COM client like
VBScript.
I would like to display the form and update the form during the
intepretation of the vbscript. Does anyone know of any good example that
could point me to the right direction.
I've already trying to achive this and the vbscript display the form but
the
performance of displaying the form is terrible. On first display it
creates
control by control and it takes seconds to display a simple form with 6
labels and a listcontrol.
The code is compiled to a windows class library containing the forms.
Any info is greatly appriciated!
BR,
Jonas