Variant.com problems

sleepinggiant member35572 at dbforums.com
Tue Aug 12 15:15:43 CEST 2003


Hi, all

Reletivly new to python (all of one week now) and have stumbled across a
nasty problem, hopefully you will be able to help me with it.

When setting a COM process to read a value from
a pre-defined register index, I think, I have to change the variable
that the value will be returned to (as I have to do for the same
function in perl), into a VARIANT, However when i run the variant
code....

      'serialIndex = (win32com.client.pythoncom.VT_BYREF|win32com.clien-
      t.pythoncom.VT_I2,0)'

no matter what extension I use (i.e. VT_VARIANT or VT_BOOL etc etc) it
still returns a type mismatch error. I may be doing something wrong or
getting confused with variant processes in python. I do know the code
I use in perl to do this works so there is nothing wrong with the
program I am calling. I have looked about on the internet abit and found
it said I need to run the programs .tlb file through makepy.py, however
when i go to run makepy (from pythonwin) it brings up a box with all of
its recognised .tlb files on my system and the one i wish to change is
not there. So I went back to google (where else ;) ) and it was
suggested I should instance my COM communication through
PyIDispatch.InvokeTypes.

However as I have very little knowledge of python, I have not got a clue
how to do this. Can someone show me how I might go about doing this?

Cheers in advance,
Matt

p.s. I have seen the very 'moderate' readme file for invokeTypes on
     aspn, and couldn't make anything of it.

--
You ahve nothing to fear except fear itself


Posted via http://dbforums.com




More information about the Python-list mailing list