Started by Bob Houle, February 16, 2016, 04:41:42 PM
0 Members and 1 Guest are viewing this topic.
QuoteWhen a method returns a string (typically a BSTR one), it asks you to provide a pointer into which it will fill the string. Here no automatic conversion is supported. What you need to do here is pass a pointer to a long variable, which will be filled with the BSTR pointer. Then you can use PeekS() to read the string. Then do not forget SysFreeString() of course.Example:If MyObject\SomeMethod(@bstr_sting) = #S_OK Debug PeekS (bstr_string , -1, #PB_Unicode) SysFreeString_(bstr_string)EndIf
Prototype.l ProtoRemoveAny( param1.p-bstr, param2.p-bstr )
<long variable> = RemoveAny( s1$, s2$ )PeekS <long variable>SysFreeString <long variable>
Quotetreats it as a long value, so it doesn't really know if it is a BSTR or not.
ptr.l = RemoveAny( s1$, s2$ )MessageRequester( "", PeekS( ptr.l, -1, #PB_Ascii ) )SysFreeString_( ptr.l )
ptr.l = RemoveAny( s1$, s2$ )s3$ = PeekS( ptr.l, -1, #PB_Ascii )SysFreeString_( ptr.l )
Page created in 0.275 seconds with 20 queries.