469,283 Members | 2,303 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,283 developers. It's quick & easy.

win32: using postdata and safearray

mic
I'm stuck with following problem. Using webbrowser control I try to make
custom-made request. I found working example of this written in VBS but
porting it to Python doesn't seem to work. The key is navigate (or
navigate2) method, that accepts PostData as one of it's parameters.
As stated in reference:
"The post data specified by PostData is passed as a SAFEARRAY Data Type
structure. The variant should be of type Array and point to a SAFEARRAY Data
Type. The SAFEARRAY Data Type should be of element type Integer, dimension
one, and have an element count equal to the number of bytes of post data."

Therefore I try to send simple 'ABC' string together with HTTP request by
creating list of ascii integers [65,66,67]. The list is supposed (as far as
I understand) to be automatically converted into safearray, but instead of:
[hex]: 41 42 43

the sequence of following bytes is being sent:
[hex]: 03 00 34 00 00 00 00 00 41 00 00 00 00 00 00 00 03 00 34 00 00 00 00
00 42 00 00 00 00 00 00 00 03 00 34 00 00 00 00 00 43 00 00 00 00 00 00 00
a3 f0 00

What's curious, I noticed some small differences between using tuples and
lists - the tuple seem to add some additional bytes at the end. It looks
like some wrong conversion of types, but I don't know any idea how to fix it
or maybe convert it manually.

Regards,

Michal
Jul 18 '05 #1
0 1504

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Roland Moschel | last post: by
5 posts views Thread by Tronster Hartley | last post: by
5 posts views Thread by Ahmad Jalil Qarshi | last post: by
4 posts views Thread by Code Monkey | last post: by
6 posts views Thread by =?Utf-8?B?U2FtZWVrc2hh?= | last post: by
5 posts views Thread by Maxim | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.