Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This file will be processed by the MIDL tool to
- // produce the type library (File.tlb) and marshalling code.
- import "oaidl.idl";
- import "ocidl.idl";
- [
- object,
- uuid(43EA61FC-C17E-429B-8AAD-B71CC2F53098),
- dual,
- nonextensible,
- helpstring("IFile_RemoteInterface Interface"),
- pointer_default(unique)
- ]
- interface IFile_RemoteInterface : IDispatch{
- [id(5), helpstring("method GetState")] HRESULT GetState(BSTR sequencename, [out] LONG* sequencestate);
- };
- [
- uuid(1F19FE19-8626-4ADC-9787-077CD9D06563),
- version(2.0),
- helpstring("File Remote Interface 2.0")
- ]
- library FileLib
- {
- importlib("stdole2.tlb");
- [
- uuid(E0FDA055-B882-4026-A3D9-2EC863FCDFB9),
- helpstring("File_RemoteInterface Class")
- ]
- coclass File_RemoteInterface
- {
- [default] interface IFile_RemoteInterface;
- };
- };
- import comtypes
- import comtypes.server.localserver
- from comtypes.client import GetModule
- # generate wrapper code for the type library, this needs
- # to be done only once (but also each time the IDL file changes)
- GetModule("File.tlb")
- from comtypes.gen.FileLib import File_RemoteInterface
- class FileImpl(File_RemoteInterface):
- # registry entries
- _reg_threading_ = "Both"
- _reg_progid_ = "File.Object.1"
- _reg_novers_progid_ = "File.Object"
- _reg_desc_ = "Python engine for File"
- _reg_clsctx_ = comtypes.CLSCTX_INPROC_SERVER | comtypes.CLSCTX_LOCAL_SERVER
- _regcls_ = comtypes.server.localserver.REGCLS_MULTIPLEUSE
- def GetState(self,a,b):
- return a // i don't know what exactly should i write here
- if __name__ == "__main__":
- from comtypes.server.register import UseCommandLine
- UseCommandLine(FileImpl)
- from comtypes.client import CreateObject
- from ctypes import *
- cale = "some_path"
- x = CreateObject("File.Object")
- x.GetState(cale,b)
Add Comment
Please, Sign In to add comment