473,718 Members | 2,122 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 2979
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
3143
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 next record and so. But this runs extremly slow. 5000 records takes about 10 minutes in IE6 and I...
2
1851
by: me | last post by:
What is the downside of Cominterop? is it good practice? what does it do to memory? Thanks
3
3524
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 element "total" from the previous page and sends it to a function for formatting. Problem...
0
1154
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
2213
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); System.Runtime.InteropServices.Marshal.ReleaseComObject (oWB);
3
1263
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 databind() on the dropdown, or the hole page crash. I tested it with dataset and datareader. Both...
13
3451
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 = "'" & "TextBoxValue" & "'"
1
2248
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 type='text' name='email' /> <input type='submit' value='submit' /> </form>
3
2210
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 menu appears with options based on that city. I can't seem to get the input from these fields in the...
0
8724
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9356
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9121
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6654
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5971
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4743
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3182
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
3
2122
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.