Home > other >  About the use of COM components makepy. Py intermediate generated file how to do
About the use of COM components makepy. Py intermediate generated file how to do

Time:09-17

Makepy. Py will pop-up window, choose to use the component will be generated after some files
__pycache__ folder
Just set p y
Ceb0 2206-19 c1-11 e0 d1-89-00 c04fd7a829x0x1x0. Py like with CLID named
Dicts. Dat don't know what to do with



The problem is that how to use, there are examples? I put the name of the longest renamed in catalog, it is wrong to use in class, search of all copy each other's things, not dry

Can have a best example
Attach the middle layer generated code, can see function here are all components of
 # - * - coding: MBCS - * - 
# Created by makepy. Py version 0.5.01
# By python version 3.5.4 (v3.5.4:3 f56838, Aug 8, 2017, 02:07:06) [MSC v. 1900 32 bit (Intel)]
# the From a type library 'oledb32. DLL'
# On Wed Aug 30 13:28:14 2017
'Microsoft OLE DB Service Component 1.0 Type Library'
Makepy_version='0.5.01'
Python_version=0 x30504f0

The import win32com. Client. CLSIDToClass pythoncom, pywintypes
The import win32com. Client. Util
The from pywintypes import IID
The from win32com. Client import Dispatch

# The following 3 lines may need tweaking The for The particular server
# Candidates are pythoncom. Missing,. The Empty and. ArgNotFound
DefaultNamedOptArg=pythoncom. Empty
DefaultNamedNotOptArg=pythoncom. Empty
DefaultUnnamedArg=pythoncom. Empty

Clsids=IID (' {ceb0 2206-19 c1-11 e0 d1-89-00 c04fd7a829} ')
MajorVersion=1
MinorVersion=0
LibraryFlags=8
The LCID=0 x0

The from win32com. Client import DispatchBaseClass
The class IDataSourceLocator (DispatchBaseClass) :
'Microsoft OLE DB Service Component Automation Interface'
Clsids=IID (' {ccb2 2206-19 c1-11 e0 d1-89-00 c04fd7a829} ')
Coclass_clsid=IID (' {cdb2 2206-19 c1-11 e0 d1-89-00 c04fd7a829} ')

Def PromptEdit (self, ppADOConnection=defaultNamedNotOptArg) :
'PromptEdit'
Return the self. _ApplyTypes_ (1610743811, 1 (11, 0), (16393, 3), (), 'PromptEdit, None, ppADOConnection
)

Def PromptNew (self) :
'PromptNew'
Ret=self. _oleobj_. InvokeTypes (1610743810, LCID, 1, (9, 0), (),)
If ret is not None:
Ret=Dispatch (ret, 'PromptNew, None)
Return ret

_prop_map_get_={
"HWnd" : (1610743808, 2, 3, 0), (), "hWnd", None),
}
_prop_map_put_={
"HWnd" : ((1610743808, LCID, 4, 0), ()),
}
Def __iter__ (self) :
"Return a Python iterator for this object"
Try:
Ob=self. _oleobj_. InvokeTypes (4, LCID, 3, (13, 10), ())
Except pythoncom. Error:
Raise TypeError (" This object does not support enumeration ")
Return win32com. Client. Util. Iterator (ob, None)

The from win32com. Client import CoClassBaseClass
# This CoClass is known by the name 'DataLinks'
The class DataLinks (CoClassBaseClass) : # A CoClass
# Microsoft OLE DB Service Component Data Link
Clsids=IID (' {cdb2 2206-19 c1-11 e0 d1-89-00 c04fd7a829} ')
Coclass_sources=[
]
Coclass_interfaces=[
IDataSourceLocator,
]
Default_interface=IDataSourceLocator

# This CoClass is known by the name '1' MSDASC. MSDAINITIALIZE.
The class MSDAINITIALIZE (CoClassBaseClass) : # A CoClass
# Microsoft OLE DB Service Component Initialization Component
Clsids=IID (' {cdb0 2206-19 c1-11 e0 d1-89-00 c04fd7a829} ')
Coclass_sources=[
]
Coclass_interfaces=[
]

# This CoClass is known by the name '1' MSDASC. The PDPO.
The class PDPO (CoClassBaseClass) : # A CoClass
# Persisted the Datasource/Pooling Object
IID clsids=(' {CCB4EC60 - B9DC - 11 d1 - AC80-00 a0c9034873} ')
Coclass_sources=[
]
Coclass_interfaces=[
]

# This CoClass is known by the name '1' MSDAURL. Binder.
The class RootBinder (CoClassBaseClass) : # A CoClass
# Microsoft OLE DB Root Binder
Clsids=IID (' {FF151822 - B0BF - 11 - A80D d1-000000000000} ')
Coclass_sources=[
]
Coclass_interfaces=[
]

IAuthenticate_vtables_dispatch_=0
IAuthenticate_vtables_=[
((' Authenticate ', 'PHWND', 'pszUsername', 'pszPassword'), 1610678272, (1610678272, (), [
(36, 2, None, None), (16415, 2, None, None), (16415, 2, None, None),], 1, 1, 4, 0, 12, (3, 0, None, None), 0,)),
]

IBindResource_vtables_dispatch_=0
IBindResource_vtables_=[
((' RemoteBind ', 'pUnkOuter', 'pwszURL', 'dwBindURLFlags',' rguid,
'riid', 'pAuthenticate', 'pSessionUnkOuter', 'piid', 'ppSession'
'pdwBindStatus',' ppUnk '), 1610678272, (1610678272, (), [(13, 1, None, None), (31, 1, None, None),
(19, 1, None, None), (36, 1, None, None), (36, 1, None, None), (13, 1, None, "IID (' {8 c82 eac9d0 - ce BAF9-11-79-00 aa004ba90b} ')"), (13, 1, None, None),
(36, 1, None, None), (16397, 3, None, None), (16403, 3, None, None), (16397, 2, None, None),], 1, 1, 4, 0, 12, (3, 0, None, None), 0,)),
]

ICreateRow_vtables_dispatch_=0
ICreateRow_vtables_=[
((' RemoteCreateRow ', 'pUnkOuter', 'pwszURL', 'dwBindURLFlags',' rguid,
'riid', 'pAuthenticate', 'pSessionUnkOuter', 'piid', 'ppSession'
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related