CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    Italy
    Posts
    90

    A little,question

    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

  2. #2
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    Re: A little,question

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured