Exiting program

volumeregeling volumeregeling at hotmail.com
Thu Jan 20 11:34:52 EST 2000


Hi,

I am not very good in searching through the online documentation for
python. I am trying some things which keep generating errors on
running.

I have the following program :

I am making a menubar which uses functions from a cupple of COM
objects. I want to exit my program through a stop_program function not
from any COM object.

def Exit_program():
    Editor.mnuFile_Exit()
    sys.exit()                        <-- for some reason this also
doesn´t work. but that on problem jet.

Editor in the above is a COM object, with the method from that COM
object to close it.

When the editor.mnuFile_Exit() method is invoked , python crashes with
some OLE error. But when I run the COM object from WScript it exits
fine so the problem is in python.

I hooked the Editor COM object the following way :

Editor= win32com.client.Dispatch("Comeditor.Classeditor")

Can anyone tell me how to "release" the COM object ??
Editor.release() doesn´t work.

I also can´t seem to get a variable COMMAND_Button to the Exit_program
procedure. I need to close the menubar with command_button.quit(), ubt
then it must be invoked from the procedue where command_button is
created


Can anyone tell me how to pass-throug this caommand_button so i can
invoke command_button.quit() from the Exit_program function.



More information about the Python-list mailing list