ActiveX component cant create object: Mercury.ObjectRepositoryUtil - vbscript

I created a VB script that converts the Object Repository file (.tsr) of QTP to XML and then to Excel. This Excel file format is configured via the VB script as well. It works well however, I am trying to run this on a new machine and I get an error:
ActiveX component cant create object: Mercury.ObjectRepositoryUtil.
Script:
Public Function ExportTSRToXML(TSRPath,XMLPath)
Set XMLRepositoryObj = CreateObject("Mercury.ObjectRepositoryUtil")
XMLRepositoryObj.ExportToXML TSRPath, XMLPath
ExportTSRToXML = XMLPath
Set XMLRepositoryObj = Nothing
End Function
Here are my steps to fix this:
1. Registered RepositoryUtil.dll with REGSVR32
2.using CSCRIPT.exe under SYSWOW64 ran the vbscript file
At step 2 mentioned above, I see the error when the script is executed :
"Microsoft VBScript runtime error: invalid procedure call or argument"
What Am i missing? Cant figure it out.
Thank you for your help. Again, this code works completely fine on multiple machines. The new Machine (64bit) has Unified Functional tool 11.5 instead of QTP 11.0.

Try to start the script from command line with: %SystemRoot%\SysWow64\cscript <yourscript-here>.
The 64 bit machine automatically starts a 64 bit interpreter and this com object is not compatible with it

Related

Using GetObject with file argument produces Error 432: File name or class name not found during Automation

I have a screen scrapping application which is in VB6, It is running on windows server 2003 and now we wanted to upgrade to windows server 2012 64 bit.
I have a problem running the below code, it gives:
Error 432: File name or class name not found during Automation
operation
(ref)
GetObject("E:\Robots\Sessions\session1.edp")
I also tried specifying the class name
GetObject("E:\Robots\Sessions\session1.edp","Extra.system")
Also tried CreateObject first and then GetObject, none of them seems to be working.
Thanks,
Remya

RegAsm.exe unable to register Dll through installshield 2016

We have installshield 2016 and inside this we are running installer script. That script is call through custom action.
So we are written following commnad to register "mydll.dll" as below mentioned command,
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /codebase mydll.dll
The above command works perfectly fine when run manually through command prompt with administrative access.But fails through installer created using installshield script custom action.
To run command we use LaunchApplicationAndWait() and LaunchApplication() functions as
strcmd = "path to cmd.exe" + "cmd.exe"
strcmdopt = "path to regasm.exe" + "regasm.exe " + /codebase + path and name of dll
ret = LaunchApplication(strcmd, strcmdopt, windir, sw_normal, infinite, LAAW_OPTION_WAIT | LAAW_OPTION_SHELLEXECUTE)
similarly
ret = LaunchApplicationAndWait(strcmd ,strcmdopt,LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN)
My Question is why both command not work when run through installshield custom action scripts
Is the dll distributed with the installation? if so, is the file present in the installdir (or wherever) when the script is called? Maybe add some msg box for debug purposes to see if this condition is met.
Im using deferred custom action to register .dll via regasm and it works just fine.
You shouldn't be calling Regasm during the install. You should put the DLL as a key file in it's own component and set the COM Interop = True attribute. This will cause InstallShield to perform a regasm /regfile during the build and take the output and dynamically author it into the Registry table. During the install, MSI will simply copy the file and apply the registry entries and your done.
Note: Per MSDN doco custom functions are not called during regasm /regfile so if you are doing any wierd self registration inside your class you'll need to author that into the installer.

Trouble Creating and Executing an Intel SGX Enclave

I'm very new to SGX and wanted to start with something simple. Fortunately, I found this very basic tutorial. Unfortunately, as simple as it is, I can't get it to work. The code executes, but there are errors in the output.
[sgx_create_enclavew ..\urts\win\urts.cpp:195] Couldn't open file with CreateFile()
error 0x200f, failed to create enclave.
Buffertests:
Buffer before change: Hello World!
Buffer after change: Hello World!
Stringtests:
Returned Secret:
Saved Secret: My secret string
Load Secret:
Integertests:
secretIntValue first load: 0
saved a 1337 to the enclave.
secretIntValue second load after 1337 was saved: 0
error, failed to destroy enclave.
image of output
the tutorial says:
If you get the error SGX couldn't find the enclave file. The solution is to move the enclave_test_save.signed.dll into the same folder where the app_test_save.exe is located.
which I've tried, but it didn't solve the problem.
when I try to create the enclave using:
sgx_create_enclave(ENCLAVE_FILE, SGX_DEBUG_FLAG, &token, &updated, &eid, NULL);
it returns: SGX_ERROR_ENCLAVE_FILE_ACCESS
could the problem be a result of using a different version of Visual Studio? (The tutorial uses VS 2012, while I'm using VS 2015)
Did you run the application through command prompt or from IDE?
If you are using IDE, You need to change the debugging properties to $(OutDir) from $(ProjecttDir) under Project Properties->Configuration Properties->Debugging->Working Directory.(Both Enclave and Application) Select the Intel(R) SGX Debugger.
Disclaimer: I had the same error although under a different setting (Ubuntu, eclipse) so I am not sure to what extent this will help.
Before initialize_enclave() is called (which in turn calls sgx_create_enclave()), a chdir(absolutePath) command needs to be executed, where absolutePath needs to be the absolute path to where your executable is.
My error was due to a wrong path I used.
Thanks, I solved it. turns out I had to place enclave_test_save.signed.dll in the root folder with the .edl file and not with the .exe file.

Active component cant create obj error

I am trying to script for file transferring ,its works fine when am clicking manually the script.But when am trying to run as Scheduling task i receiving an error "Active component cant create obj",i don't know what went wrong in my script?
For your reference i have my script below.
Dim Mysite
Set MySite = CreateObject("CuteFTPPro.TEConnection")
Set fso = CreateObject("Scripting.FileSystemObject")
MySite.Protocol = "FTP"
MySite.Host = "www.domainname.com"
MySite.Login = "xxxxx"
MySite.Password = "xxx"
MySite.UseProxy = "BOTH"
MySite.Connect
MySite.UploadAsync "C:\sampletest\abc.flv"
MySite.RemoteFolder = "/test/abc.flv"
MySite.Disconnect
MySite.Close
FYI my machine is windows 2008 64 bit system
In most cases issue raised by one of the following:
User does not have proper permission to run a scheduler
User does not have proper access to the folders/files listed
Application you are using running under different permission set for logged in user and system account which is used by Task Scheduler.
OS is not recognizing what application version it have to execute 32 or 64 bit when attempt to execute scheduled task.
Take a closer look on those situations, make adjustments and it will work.

Why do I get a 1720 error when my InstallShield setup tries to run my VBS custom action?

The Custom Action is configured as follows:
Custom Action Name: MyCustomAction
VBScript Filename: <PathVar01>\MyFolder\MyVBSfile.vbs
ScriptFunction: MyFunction
Return Processing: Synchronous (Check exit code)
In-Script Execution: Immediate Execution
It is being executed via the following InstallScript code:
result = MsiDoAction(ISMSI_HANDLE,"MyCustomAction");
When the setup reaches that line in InstallScript, the installer shows an error alert, stating:
"Error 1720.There is a problem with
this Windows Installer package. A
script required for this install to
complete could not be run. Contact
your support personnel or package
vendor."
The result code returned by MsiDoAction is that of '1603', which, according to winerror.h, is:
//
// MessageId: ERROR_INSTALL_FAILURE
//
// MessageText:
//
// Fatal error during installation.
//
#define ERROR_INSTALL_FAILURE 1603L
Why is this happening? I was starting to doubt that the file was included properly. Yet, I am pointing to the correct file, and I've tried including the VBS via the InstallShield Support Files, thinking this would ensure the file was present with the setup, but same result.
Running the setup with logging enabled revealed the problem:
Action 13:29:19: MyCustomAction.
Action start 13:29:19: MyCustomAction.
Error 1720.There is a problem with
this Windows Installer package. A
script required for this install to
complete could not be run. Contact
your support personnel or package
vendor. Custom action MyCustomAction
script error -2146827278, Microsoft
VBScript compilation error: Expected
identifier Line 163, Column 37,
blnExample,)
To run a setup with logging enabled:
"C:\SetupFolder\setup.exe" /V"/l*v
c:\Install.log"
This forum thread was helpful.

Resources