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
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
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
&
, 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
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
"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
> 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
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.
>
"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
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
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
11 matches
Mail list logo