Re: win32com, BSTR, and null terminated strings

2006-02-06 Thread Matt Helm
"John Bauman" <[EMAIL PROTECTED]> writes: > "Matt Helm" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> However, what is the proper way to recover the actual string? I have >> been using: >> >>r.split("\0", 1)[0] >> > I'd prefer to use > r[:-1] > to strip off the last charact

Re: win32com, BSTR, and null terminated strings

2006-02-06 Thread Matt Helm
> It's perfectly good Python, though, so just forget about it or wrap it > in a "cstring(s)" function do you don't have to look at it! Thanks for the sanity check. I just wanted to make sure I was correct as well as right. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com, BSTR, and null terminated strings

2006-02-06 Thread Steve Holden
John Bauman wrote: > "Matt Helm" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>However, what is the proper way to recover the actual string? I have >>been using: >> >> r.split("\0", 1)[0] >> > > I'd prefer to use > r[:-1] > to strip off the last character of the string. >

Re: win32com, BSTR, and null terminated strings

2006-02-05 Thread John Bauman
"Matt Helm" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > However, what is the proper way to recover the actual string? I have > been using: > >r.split("\0", 1)[0] > I'd prefer to use r[:-1] to strip off the last character of the string. -- http://mail.python.org/mailman/l

Re: win32com, BSTR, and null terminated strings

2006-02-05 Thread Steve Holden
Matt Helm wrote: > > I am using win32com to access a third party COM interface but am > having trouble using the string that is returned. > > The vendor's docs show the following method: > > HRESULT CookString(BSTR param_a, short buf_size, [out, retval] BSTR* > result_b); > > param_a is a

win32com, BSTR, and null terminated strings

2006-02-05 Thread Matt Helm
I am using win32com to access a third party COM interface but am having trouble using the string that is returned. The vendor's docs show the following method: HRESULT CookString(BSTR param_a, short buf_size, [out, retval] BSTR* result_b); param_a is a string to be processed. buf_size is