VBS gets empty string

From: Eran (even_e_at_netvision.net.il)
Date: 07/28/04


Date: Wed, 28 Jul 2004 16:10:22 +0300

Hi,

I need help for the following issue. I have a COM server in C++ and client
in VBS. in some reason, the VBS gets empty string from COM.

the implemintation is as follows:

[COM]
[id(4), helpstring("method RetString")] HRESULT ReturnString([out] BSTR
*RetString);

STDMETHODIMP CETS_Interface::ReturnString(BSTR *RetString)
{

 char MyString[10] = "temp";
 *RetString = A2BSTR(MyString);
 return (*RetString != NULL) ? S_OK : E_OUTOFMEMORY;
}

[VBS]

 ' ETS_Interface of "ETS.ETS_Interface.1"
' ETS_Interface Class
Set objETS_Interface = CreateObject("ETS.ETS_Interface")

Dim mystring

 objETS_Interface.RetString(mystring)
MsgBox(mystring) ' in some reason, I mystring is empty here.



Relevant Pages

  • Re: DirectShow
    ... I have an example from Microsoft that uses DirectShow to does this. ... Another reason is that VBS only supports automation datatypes ... Yet another reason is that VBS requires IDispatch-support ... You'll probably have a hard time using VB-6 instead of C++ ...
    (microsoft.public.scripting.vbscript)
  • Re: Unable to connect a website using LWP
    ... shouldn't have any reason to. ... Hmm. ... inequality operations (testing if the status code returned is>= 200 ... you compare an empty string to a number using the == operator, ...
    (comp.lang.perl.modules)
  • Re: Where to place a constant?
    ... an empty string has no ... you'll limit code reusability somewhat. ... That again depends on the implementation you use, not only on settings. ... That's of course a very good reason to write your own ones, ...
    (comp.lang.cpp)
  • Re: Pass Variable to external VBS
    ... the only reason I was going to pass it to vbs is ... For some reason, I am still having issues with passing whatever is ... my Visual Basic form, I just have a text box and a button. ... Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: coredump in df_readascii
    ... OS: AS3 ... Reason: df_commentschars is null. ... Strange. ... You can set it to an empty string, ...
    (comp.graphics.apps.gnuplot)