473,563 Members | 2,904 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# slow form COMInterop VBScript

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
Jan 10 '06 #1
3 2965
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

Jan 10 '06 #2
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


Jan 10 '06 #3
Well I don't think it has to do with the CLR, since when I'm using
..showdialog it show the form as fast as it should be. Thou that is not an
optio in this case since I would like to update the form controls and
properties from VBScript.

//Jonas

"Drwtsn32" wrote:
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


Jan 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3131
by: Shay | last post by:
essentially I am trying to do some counts based on some assumptions in the recordset. So I get the RS back, put the values into a variable, move to the next record in the RS and compare what is in the variable to the value in the next record in the recordset and do a count. Then overwrite the value in the variables and do the same for the...
2
1837
by: me | last post by:
What is the downside of Cominterop? is it good practice? what does it do to memory? Thanks
3
3520
by: Abby Lee | last post by:
My code works but because I'm using VBscript within JavaScript I get an error message...the yellow tri-angle with an "!" mark. ---------------within my body------------- <script language="JavaScript">document.write(formatCurrency(<%=Request.Form ("total")%>))</script> ------------------------------------------ My script takes the form...
0
1149
by: Mário Sobral | last post by:
Hi ! I have developed a .NET library that references another .NET library. MyLibrary -> OtherLibrary I then create a COMInterop wrapper assembly to use it from a VB6 project:
4
2194
by: Ariel Gimenez | last post by:
Hi in my app im working with excel using cominterop when fished my work with excel i execute this code oWB.Close(null,null,null); oXL.Workbooks.Close(); oXL.Quit(); System.Runtime.InteropServices.Marshal.ReleaseComObject (oXL); System.Runtime.InteropServices.Marshal.ReleaseComObject (oSheet);...
3
1259
by: catweezle2010 | last post by:
Hello, I fill a dropdown with data from sql server with vbscript. In the view on the sql server are just citynames, only one row. To fill the dropdown takes round about 4 seconds. That's not nice, but if it only happens on page load, I can live with it. The realy bad thing is the posback. Either it takes 20 seconds and more, if I do a...
13
3436
by: eighthman11 | last post by:
using Access 2003 and sql server version 8.0 Hey everyone. Created a text box where the user types in an Inventory number and it takes them to that inventory number on the contimuous form. The form is based on a link table to sql server. Here is the code: Dim rst As DAO.Recordset Dim InventoryItem As String InventoryItem = "'" &...
1
2237
by: Ramsesz | last post by:
Hi all, I am new here (forgive me if I do not follow forum-rules which i am not yet familiar with). I have a problem that bugs me quite some time now. I did not find any solutions on the net, so I hope you guys can help me out! I have a very simple html form (for test purposes): <form method='post' action='processForm.asp'> <input...
3
2195
by: ibeehbk | last post by:
Hi. I have a form made in xhtml. I test via vbscript to make sure none of the fields are empty and properly formatted (ie email). All the regular fields work. However, I have two drop down menus that are SELECT elements (javascript-- one named arrivalcity and one named returncity). Basically they ask for a departure and return city and another...
0
7665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.