Re: Retrieving BSTR * from a DLL

2008-07-10 Thread mzdude
x27;m not seeing the returned BSTR. > You might like to join the ctypes-users mailing list at sourceforge. I did, thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Retrieving BSTR * from a DLL

2008-07-10 Thread Andrew MacIntyre
mzdude wrote: I need to interface with a windows DLL that has the following signature extern "C" void Foo( BSTR in, BSTR *out ) Code so far from ctypes import * import comtypes LPBSTR = POINTER(comtypes.BSTR) hdl = windll.MyDll.Foo hdl.rettype = None hdl.argtypes = [comtypes.BS

Retrieving BSTR * from a DLL

2008-07-09 Thread mzdude
I need to interface with a windows DLL that has the following signature extern "C" void Foo( BSTR in, BSTR *out ) Code so far >>> from ctypes import * >>> import comtypes >>> LPBSTR = POINTER(comtypes.BSTR) >>> >>> hdl = windll.MyDll.Foo &

BSTR

2006-04-13 Thread Aleksandar Cikota
, the filename argument is declared as a variant. What the type library doesn't tell you is that the variant must be either a BSTR (unicode string with header) or a reference to a BSTR. Specifically, the 'vt' member of the VARIANT must be either VT_BSTR or VT_BSTR|VT_BYREF. Does pyt

BSTR

2006-04-13 Thread Aleksandar Cikota
y, the filename argument is declared as a variant.  What the typelibrary doesn't tell you is that the variant must be either a BSTR (unicodestring with header) or a reference to a BSTR.  Specifically, the 'vt' memberof the VARIANT must be either VT_BSTR or VT_BSTR|VT_BYREF.   Does py

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* &g

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