Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with the script

Posted on 2014-09-21
21
Medium Priority
?
52 Views
Last Modified: 2015-09-10
Hi,
I do use this script
https://dl.dropboxusercontent.com/u/40211031/CallDotNetDll.vbs

within Win 7/win 2008 server, to call this VB project
https://dl.dropboxusercontent.com/u/40211031/CSDemo.zip

while I also have followed these

Register COM DLL file in Windows 7
Start --> Run --> comexp.msc
Navigate to Console Root - Componet Services - Computers - My Computer - COM+ Applications.
Right click on 'COM+ Applications' and create New Application.
Follow the wizard carefully. Hit Next. Create an Empty Application. Name it (mycomapp1 for instance). Make sure Server application radio box is selected. Pick the user account based on the requirement. Hit Next. Next. Finish.
Now you have created a COM+ application named mycomapp1.
Now, you need to add individual COM components to it.
Expand mycomapp1 from the list. Right click on Components. Pick New Component.
Hit Next in the wizard. This next wizard screen is up to you. I would pick 'Install New components' if I haven’t run a regsvr32 or regasm on it. Pick the told or the dll (containing the tlb) file. And go ahead.. That’s how you do it.

to register both .dll and .tlb (which are built from the VB project) within the machine. but when running the VB script, I get the error attached

any advice?
t821.png
0
Comment
Question by:HuaMinChen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 5
  • 2
21 Comments
 
LVL 46

Expert Comment

by:aikimark
ID: 40335837
please post your VBScript code
0
 
LVL 83

Expert Comment

by:David Johnson, CD, MVP
ID: 40335841
run the vbs script as an administrator is my best guess as it is a permissions error
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40335858
Thanks all.
I am using Administrator account.

Aiki,
Do you see the .vbs file above?
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
LVL 46

Expert Comment

by:aikimark
ID: 40335906
I was looking for an EE attached file or source.  I now see the file you have uploaded to Dropbox.  Please ignore my earlier comment.

From the variable names, I would guess that the ActiveX object expects double precision floating point parameter values.  Your VBS code is supplying string values.
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40335954
Sorry, I was handling with Text only in the project.
Any advice to do any change?
0
 
LVL 46

Accepted Solution

by:
aikimark earned 1000 total points
ID: 40336402
First thing to try is to surround the parameters with parentheses
dblResult = objFunc.Func1((dblValue1), (dblValue2), (dblValue3))

Open in new window


If that doesn't work, cast the variables as strings
dblResult = objFunc.Func1(CStr(dblValue1), CStr(dblValue2), CStr(dblValue3))

Open in new window

0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40338224
Many thanks. I did adjust VB script
https://dl.dropboxusercontent.com/u/40211031/CallDotNetDll.vbs

but I still get the error attached
t822.png
0
 
LVL 46

Expert Comment

by:aikimark
ID: 40338266
In VBScript, all the variables are variant.  Do not include the As datatype clause to your Dim statements.
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40338276
Many thanks. I did adjust VB script again
https://dl.dropboxusercontent.com/u/40211031/CallDotNetDll.vbs

but I still get the error attached, when finishing to call the dll file, from VB script.
t823.png
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40340722
Many thanks.
Any other help?
0
 
LVL 46

Expert Comment

by:aikimark
ID: 40340739
I don't have an environment that I can test the VB.Net project and your VBScript.
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40340757
Thanks. Can I have your email address, as I think I can share with you the relevant machine, by Teamviewer?
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40340761
If you're available. Thanks again.
0
 
LVL 83

Expert Comment

by:David Johnson, CD, MVP
ID: 40340816
Thanks. Can I have your email address, as I think I can share with you the relevant machine, by Teamviewer? we can't enter email addresses in a question as it is supposed to be solved with the solution available for everyone via the website. That being said check the experts profile for a hire me button
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40340818
Thanks. Can you please help to my problem?
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40341079
Any help?
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40343149
Dear all,
Any other help?
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40343152
Here is the relevant project for the DLL
https://dl.dropboxusercontent.com/u/40211031/CSDemo.zip
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40345479
Any help to this?
0

Featured Post

How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question