On 20 Mar, 19:09, Craig <[EMAIL PROTECTED]> wrote:

> The following is the C++ prototype for one of the functions:
> short FAR PASCAL VmxOpen(BSTR    *Filespec,
>                          LPSHORT  lpLocatorSize,
>                          LPSHORT  lpOmode,
>                          LPHANDLE lphwmcb,
>                          BSTR    *Password);


import ctypes
import comtypes

LPBSTR = ctypes.POINTER(comtypes.BSTR)
HANDLE = ctypes.POINTER(ctypes.POINTER(ctypes.c_long))
LPHANDLE = ctypes.POINTER(HANDLE)
LPSHORT = ctypes.POINTER(ctypes.c_short)

VmxOpen = ctypes.windll.vbis5032.VmxOpen
VmxOpen.restype = c_short
VmxOpen.argtypes = [LPBSTR, LPSHORT, LPSHORT, LPHANDLE, LPBSTR]


Filespec = comtypes.BSTR('blahblahblah')
LocatorSize = ctypes.c_short(256)
Omode = ctypes.c_short(1)
hwmcb = HANDLE()
Password = comtypes.BSTR('blahblahblah')


res = WmxOpen( byref(Filespec), byref(LocatorSize),
   byref(Omode), byref(hwmcb), byref(Password) )


or if that fails:

pFilespec = ctypes.pointer(Filespec)
pLocatorSize = ctypes.pointer(LocatorSize)
pOmode = ctypes.pointer(Omode)
phwmcb = ctypes.pointer(hwmcb)
pPassword = ctypes.pointer(Password)

res = WmxOpen( pFilespec, pLocatorSize, pOmode, phwmcb, pPassword )














-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to