A simple wrapper around ``CoCreateInstance ``
(clsiid, targetinterface, custom_iid=None, context=CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER)
| 70 | return res |
| 71 | |
| 72 | def create_instance(clsiid, targetinterface, custom_iid=None, context=CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER): |
| 73 | """A simple wrapper around ``CoCreateInstance <https://msdn.microsoft.com/en-us/library/windows/desktop/ms686615(v=vs.85).aspx>``""" |
| 74 | if custom_iid is None: |
| 75 | custom_iid = targetinterface.IID |
| 76 | if isinstance(clsiid, basestring): |
| 77 | clsiid = IID.from_string(clsiid) |
| 78 | winproxy.CoCreateInstance(byref(clsiid), None, context, byref(custom_iid), byref(targetinterface)) |
| 79 | return targetinterface |
| 80 | |
| 81 | |
| 82 | def resolve_progid(progid): |
nothing calls this directly
no test coverage detected