Problems with passing VB arrays to a COM object

Chris Spencer clspence at one.net
Tue Dec 17 18:01:19 EST 2002


I am attempting to access a COM object for some OCR work, but I'm running into a
problem that I need help with.

The documentation for this API gives a small tutorial in VB for the function
call "SetActiveLangs".  As you can see from the code below, one of the
parameters is a VB array.  I don't know of any Python equivalent to a VB array.
The few things that I've tried have made it blow up in a "Memory Error".

VB Example:
Private Sub SetLangs_Click()
   Dim LangSubIds(1) As Long
   
   LangSubIds(0) = LANG_ID_ENGLISH
   RasterOCR.SetActiveLangs LANG_GROUP_ID_LATIN1, LangSubIds, 1
End Sub

Any ideas how I can represent this function in a Pythonic way, substituting a VB
array with a Python representation.

Any help I can get would be very appreciated.

Chris.




More information about the Python-list mailing list