Using calldll with mciSendString

Nikolai Kirsebom nikolai at micon.no
Wed Jun 19 18:46:44 EDT 2002


Got the first part working.  Problem was the name of function is not
"mciSendString" but "mciSendStringA".  Below part which works.  Still
working on the callback stuff.

---------------------------------------------------------
from dynwin import windll
winmm = windll.module('winmm')

def Send(s, cb=None):
    mciSendString=windll.calldll.get_proc_address(winmm.handle,
"mciSendStringA")
    bufIn=array.array('c', s + '\0')
    bufOut=array.array('c', '\0' * 128)
    ret=windll.calldll.call_foreign_function(mciSendString, 'wwLL', 'l',
                                             (bufIn, bufOut, 128L, 0L))
    s = bufOut.tostring()
    if s.index('\0') > 0:
        s = s[0:s.index('\0')]
    else:
        s = ""
    return (ret, s)






"Nikolai Kirsebom" <nikolai at micon.no> wrote in message
news:nNOP8.3825$yj7.62301 at news4.ulv.nextra.no...
> I'm trying to use the windll/calldll module to access the mciSendString
> (winmm.dll) function.  One of the parameters to the function is a string
> containing returned information.  I'm using wxPython as GUI to show a AVI
/
> MPEG movie (in a wxPanel).  The play command may be given a 'notify' flag,
> which results in the player calling back to notify when movie is finished.
> The last parameter to the mciSendString is a HANDLE (hwndCallback).
>
> Can someone give an example how to retreive the returned information and
> also how I set up the callback.
>
>
> Thanks
> Nikolai Kirsebom
>
>
>





More information about the Python-list mailing list