Click to See Complete Forum and Search --> : A little,question


joecre
December 2nd, 2004, 03:13 AM
Hi everybody, I have the following problem I'm trying to use from vbscript a method of a COM Server exe, this method returns byref two strings but unfortunately I'm not able to receive these strings.
Here you are the source code

<script language=vbscript>
Option Explicit
Dim myObj
Set myObj = CreateObject("MyCompLib.MyClass.1")
Dim bstrCatalog
Dim bstrSource
bstrCatalog = "CATALOG"
bstrSource = "SOURCE"
myObj.MyMethod1 CStr(bstrCatalog), CStr(bstrSource)
MsgBox bstrCatalog
Set myObj = Nothing
</script>

The method has the following signature
HRESULT MyMethod1([out] BSTR* bstrDataSource, [out] BSTR* bstrCatalog, [out, retval] long* nErrCode)
Can someone give me a little halp?
Thank you

visualAd
December 4th, 2004, 07:35 AM
Have you tried using the third function parameter which returns an error code, to see if any errors have aoccured. If you are running this VB Script in Internet Explorer, you may also find it useful to turn on scripting errors in the advanced section of the Internet Properties.

The most likeley scenario is that it has failed to create an instance of the object, due to the security settings, remember these objects need to be verified and signed before you can use them.