For registering the com server we use innosetup with the following line
[Run]
Filename: "{app}\openclerk.exe"; Parameters: "/regserver"; WorkingDir: "{app}" 
; StatusMsg: "Registering openclerk.exe ..."

---
I’ve used a variation of this techinque, it seems to work fine. Thanks. 

  usually you get this error because you miss some reference into py2exe
  the way that we use to trace this error is to try catch all com method even 
the __init__ and use the logging system:

  ----
I haven’t been able to figure out how to integrate your example into my own 
code. The COM/py2exe integration is wholly opaque to me. Here is my code, can 
you or anyone else suggest what I might be doing wrong? 

from quickwho_main import quickwhoApp
import time
import tempfile
from win32com.server.exception import COMException
import winerror
import win32com.server.register

#expose basic functionality to COM 
class QuickWho_Domain:
  _public_methods_ = ['GetDomain']
  _reg_progid_ = 'QuickWho.Application'
  _reg_clsid_= '{9F825846-F10B-47DD-91E8-88DA93C1A05E}'

  def GetDomain(self, domain):
      try:
         app.searchfield.delete(0, 'end')
         app.searchfield.insert(0, str(domain))
         app.getInfo()
         time.sleep(1)
         alltext=app.getData()
         tempfile = tempfile.gettempdir()+ '/urltext.txt'
         data = open(tempfile, 'r')
         finaltext = data.read()
         data.close()       
         return finaltext
      except:
          raise COMException(desc='Unable to retrieve domain data',
                            scode=winerror.E_FAIL)

try:
  win32com.server.register.RegisterClasses(QuickWho_Domain)
except:
  pass

app = quickwhoApp(None)
app.mainloop()

The idea is to use the COM method (GetDomain) to drive the app’s UI (which in 
turn fires to external executables via subprocess), parse the data, display it 
in the GUI , and then return the data to the calling application. Is this how 
COM is supposed to work? This is how the app works on the Mac in responding to 
AppleScript calls. Perhaps it’s not the right mechanism for Windows, although I 
don’t know of a better one that can be accessed from the MS desktop scripting 
languages, cf. VBScript.

Suggestions are appreciated. I’m about to give up on this, as I can’t grok it.

--Kevin 
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to