473,416 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Active-X error CreateObject("ScriptControl")

Hi,

I have a Visual Basic application using Createobject("ScriptControl") to convert a user input like 3+3 to 6. This worked perfect under Windows XP and even Windows 7 but on my new Windows 2008 Server (64 bit) it gives an error: Cannot Create ActiveX component. Should I register or refer anywhere ? Should I install anything ?

Expand|Select|Wrap|Line Numbers
  1. Dim SControl = CreateObject("ScriptControl")
  2. SControl.language = "VBScript"
  3. Totalfee = SControl.eval(TotalfeeTextBox.Text)
I hope anybody can help me !

Freddie
Jul 2 '10 #1
2 9903
!NoItAll
297 100+
Alfredo:
There are TWO things you need to be aware of.
1. You need to deploy MSSCRIPT.OCX with your application. There are no dependencies for it apparently, but you should still deploy the MSSCRIPT.DEP with it.
2. It is only a 32 bit control so any program you use with it must be x86 ONLY. Creating an assembly that JITs to a native 64 bit app will NOT work.

Also - if you are using it in vbscript it gets tricky - because, by default, any vbs script on a 64-bit OS will execute as a native 64 bit application. This means that any objects created from 32-bit DLLs or ActiveX (OCX) files simply will not work. To use those 32 bit components on a 64 bit system you have to execute the .vbs script using the cscript.exe that is located inside the SysWOW64 folder on the 64-bit system.

c:\SysWOW64\cscript myscript.vbs

Simply double clicking on a vbs script will not work. You might try to get fancy and see if you can rename a script from xxx.vbs to xxx.s32 and register it for the syswow64 copy of cscript...

I have heard tales of folks copying the cscript.exe from syswow64 to the c:\windows\system folder - but I'm dubious... That will likely break more than it fixes. That would actually be a very bad thing to do as vbs scripts are used by more applications then you might think - including MANY installers! If you force all VBS scripts to run as 32 bit - then they will not be able to create any 64-bit objects.
Jul 10 '10 #2
@!NoItAll
Hi NoItAll,

Thanks for your reply. I was on holiday so could not respond earlier. I am not too good with Visual Basic so do not understand your reply. Can you please help me further. The Visual Basic application is installed on my X64 system itself, it is not used for distribution. Seen from the Visual Basic application, if I am in the debugger, can you please explain me how I should change my script ? I do not understand where to use the c:\SysWOW64\cscript myscript.vbs.....

Hope you or anyone can help me.

Regards,

Alfred
Jul 29 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jeff Thies | last post by:
Hello, I (well someone else) need to upload large files. I had the Huge ASP upload installed (Pstruh). It came recommended here. Using the sample script I get this error when uploading: ...
0
by: JC | last post by:
On my development PC, which is the machine that i 'build' my .net project, I have successfully exposed my .net dll to my vb6 application..intellisense and all. I have then used regasm to...
2
by: danijel.balun | last post by:
Hello All. I have A big problem. We have a small application in MS Access. After the reinstallation of system (Windows 2000 Professional) we get a following error: "The Expression On Click you...
1
by: John Gabriel | last post by:
I have set up a website and am testing ASPs. I have created a very simple ActiveX component with two interfaces: AboutBox() - displays About details calcpi() - returns 3.14159 Here is my...
1
by: John Gabriel | last post by:
I have set up a website and am testing ASPs. I have created a very simple ActiveX component with two interfaces: AboutBox() - displays About details calcpi() - returns 3.14159 Here is my...
2
by: Khan | last post by:
Hi, I'm using acrobat reader contorl in my vb.net application to display pdf files. I'm using version 8.0 of acrobat, but if i run my application on other machine which has different version of...
0
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi, I'm using a control called "TX Text Control Activex Server" load and display word documents and export them as pdf, rtf ...etc and this is the code that should load a word document the...
1
by: rslheath | last post by:
Hi, Running Access 2002 on XP and when trying to create a workspace using: Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet) Windows attempts to configure Norton CleanSweep. A Norton...
0
by: DevilInside | last post by:
Hi I'm using in my C# application the component DHTMLEdit. This component works great until I install it on another computer via a setup file. I always get this error when I'm trying to open a...
0
by: kaushalgajjar | last post by:
Hi, I had created an active-x control (ocx) in vb6 and i have used in VB.Net and HTML using ClassId reference and the active-x was working fine with ASP.Net, HTML and VB6. Now the active-x is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...

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.