Windows Common Item Dialog: ctypes + COM access violation
问题 I am trying to use the ctypes module to make calls to Windows' Common Item Dialog API. The code shown below is roughly based on the steps outlined in the MSDN documentation. Its only dependency is the comtypes.GUID module. import ctypes from ctypes import byref, POINTER, c_int, c_long from ctypes.wintypes import HWND, HRESULT from comtypes import GUID CLSID_FileOpenDialog = '{DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7}' IID_IFileDialog = '{42F85136-DB7E-439C-85F1-E4075D135FC8}' #IID_IFileOpenDialog