By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,222 Members | 2,374 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,222 IT Pros & Developers. It's quick & easy.

VB ActiveX EXE & Python

P: 1
Hi..
I can't speak english very well.

I have writting code a program with VB & Python

- COM Server : Visual basic (ActiveX EXE)
- COM Client : Python

I expect to attempt that is retrieved a return value.
but, don't returned a event value ( in python)
why?
I amd certain to need help.


>>> python source
Expand|Select|Wrap|Line Numbers
  1. import win32com
  2.  
  3. class VBEventHandler:
  4.     def OnActionButton(self,id):
  5.             print "event vbmodeless", id
  6.  
  7. obj = win32com.client.DispatchWithEvents("VBnM3Test5.WithEventForm",VBEventHandler)
  8.  
  9. obj.Show()
>>> VB Source : ActvieX Exe (with form(vbmodeless) & events)

Expand|Select|Wrap|Line Numbers
  1. Event OnActionButton(ByVal id As Integer)
  2. Private WithEvents Wef As Form1
  3.  
  4. Private Sub Class_Initialize()
  5.     Set Wef = New Form1
  6. End Sub
  7.  
  8. Public Sub Show()
  9.     Wef.Show
  10. End Sub
  11.  
  12. Private Sub Wef_OnActionButton(ByVal id As Integer)
  13.     RaiseEvent OnActionButton(id)
  14. End Sub
Apr 27 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.