Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > PyVariant anyone

Reply
Thread Tools

PyVariant anyone

 
 
Paul Keating
Guest
Posts: n/a
 
      07-14-2003
I need to call a C++ DLL from Python, for which I'm planning to use
boost.python. But the DLL has been written to a VBA interface, and this
means it expects to get variable length arrays as Windows Variants instead
of lists or tuples.

Anyone know how to construct a convincing Windows Variant in Python?


 
Reply With Quote
 
 
 
 
Andrew MacIntyre
Guest
Posts: n/a
 
      07-14-2003
[posted & mailed]
On Mon, 14 Jul 2003, Paul Keating wrote:

> I need to call a C++ DLL from Python, for which I'm planning to use
> boost.python. But the DLL has been written to a VBA interface, and this
> means it expects to get variable length arrays as Windows Variants instead
> of lists or tuples.
>
> Anyone know how to construct a convincing Windows Variant in Python?


I've been able to do so with Thomas Heller's ctypes module, but I've not
got as far as dealing with arrays.

However, if you're going to use boost.python then I'd infer that you're
already using some C++ so it would be much easier to do the conversion at
the C++ interface level - my understanding is that a VARIANT is a C
structure, which for arrays points at another structure, which in turn
gives the number & type of elements and a pointer to the actual
calloc()ed array data.

--
Andrew I MacIntyre "These thoughts are mine alone..."
E-mail: http://www.velocityreviews.com/forums/(E-Mail Removed) (pref) | Snail: PO Box 370
(E-Mail Removed) (alt) | Belconnen ACT 2616
Web: http://www.andymac.org/ | Australia

 
Reply With Quote
 
 
 
 
Mark Hammond
Guest
Posts: n/a
 
      07-15-2003
Paul Keating wrote:
> I need to call a C++ DLL from Python, for which I'm planning to use
> boost.python. But the DLL has been written to a VBA interface, and this
> means it expects to get variable length arrays as Windows Variants instead
> of lists or tuples.
>
> Anyone know how to construct a convincing Windows Variant in Python?


If you can link against pythoncom.dll, there are public functions there
for it.

Mark

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone Carry Gear on Lufthansa Air? Bill? Roger? Anyone? :) MarkČ Digital Photography 34 05-20-2006 11:16 AM
Anyone who posts for Help in Here needs Intellix - Anyone providing Help Applicable Also Ditto21 Computer Support 8 02-18-2006 04:27 AM
Anyone?? Anyone at all?? JDS HTML 2 09-29-2005 07:10 PM
Anyone know anyone in Toronto Canada that will write your Mcsa Exams MonkeyMunx Microsoft Certification 17 01-05-2004 03:37 PM
Anyone? Anyone? Steve Williams Python 0 09-16-2003 03:26 AM



Advertisments