Similar Threads
1. ActiveX and Types of ActiveX Components in VB - Visual Basic
2. ActiveX control in python vs ActiveX control in vb 6 (piece of code)
Hello,
I am trying to mograte from vb 6 to python.
I have a very usefull AX control. It can be :
-just a bitmap
-an active picture where you can plot data and put cursors
-a data explorer
Those 3 behavior are driven by one property in visual studio when you
insert the AX control in a form: the property ModuleName:
-'default' for bitmap
-'Picture' for a picture
I try to insert this AX control in a wxpython based application (I
used one of the example delivered with wx) but when I try to change
the property to get an active picture it does not work and display me
the default bitmap :(
Here is the pice of code
####################################################################################
import wx
if wx.Platform == '__WXMSW__':
from wx.lib.activexwrapper import MakeActiveXClass
import win32com.client
try:
ocx = win32com.client.gencache.EnsureModule('{33924602-
C29E-4915-91B1-767CA3D675C2}',0x0,1,0)
except:
raise ImportError("Can't load ocx")
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.pdf = None
sizer = wx.BoxSizer(wx.VERTICAL)
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
# this function creates a new class that can be used as
# a wxWindow, but contains the given ActiveX control.
coclass=ocx.ActiveXModuleLoader
print coclass
coclass.ModuleName='picture'
ActiveXWrapper = MakeActiveXClass(coclass)
# create an instance of the new class
self.pdf = ActiveXWrapper(self)
#self.pdf.ModuleName='PictureManager'
sizer.Add(self.pdf, 1, wx.EXPAND)
btn = wx.Button(self, wx.NewId(), "Open PDF File")
wx.EVT_BUTTON(self, btn.GetId(), self.OnOpenButton)
btnSizer.Add(btn, 1, wx.EXPAND|wx.ALL, 5)
btn = wx.Button(self, wx.NewId(), "<-- Previous Page")
wx.EVT_BUTTON(self, btn.GetId(), self.OnPrevPageButton)
btnSizer.Add(btn, 1, wx.EXPAND|wx.ALL, 5)
btn = wx.Button(self, wx.NewId(), "Next Page -->")
wx.EVT_BUTTON(self, btn.GetId(), self.OnNextPageButton)
btnSizer.Add(btn, 1, wx.EXPAND|wx.ALL, 5)
btnSizer.Add((50, -1), 2, wx.EXPAND)
sizer.Add(btnSizer, 0, wx.EXPAND)
self.SetSizer(sizer)
self.SetAutoLayout(True)
wx.EVT_WINDOW_DESTROY(self, self.OnDestroy)
def OnDestroy(self, evt):
if self.pdf:
self.pdf.Cleanup()
self.pdf = None
def OnOpenButton(self, event):
print 'open'
def OnPrevPageButton(self, event):
print 'button'
def OnNextPageButton(self, event):
print self.pdf.ModuleName
#----------------------------------------------------------------------
def runTest(frame, nb, log):
if wxPlatform == '__WXMSW__':
win = TestPanel(nb, log)
return win
else:
dlg = wx.MessageDialog(frame, 'This demo only works on MSW.',
'Sorry', wx.OK | wx.ICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
overview = __doc__
#----------------------------------------------------------------------
if __name__ == '__main__':
import sys
class TestFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "ActiveX test",
size=(640, 480),
style=wx.DEFAULT_FRAME_STYLE|
wx.NO_FULL_REPAINT_ON_RESIZE)
self.tp = TestPanel(self, sys.stdout)
app = wx.PySimpleApp()
frame = TestFrame()
frame.Show(True)
app.MainLoop()
#############################################################################
I suspect that the activex control is bugged .... but how to know that
since it is working perfectly under visual studio vb 6 but not with
python ?:(
please help me !
3. activex exe and activex dll
4. VB6 ActiveX (OCX) Development: ActiveX tries to modify it乻 own label
[MULTIPOST]
answered in another group
"BitteKeineSpams" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
> Hi NG,
> we have the following Problem:
> We are developing an VB6- ActiveX that contains a form a label and a
> Module with Sub.
> The ActiveX- Form includes the label.
> - From the ActiveX form I can access the label via
> "UserControl.label....".
> - If we trie to access the label from Sub in the Module (the module is
> part of the ActiveX) we have no access, the Syntax "UserControl.Label..."
> is not possible it seemed that we have no access to this label.
> - The same problem occurs if we have a class integrated in the ActiveX and
> the class tries to modify the label.
> What do we have to change that we can access the label.
>
> Please note: We are not talking about the ActiveX- Interface to other
> applications, the problem occurs internal in the ActiveX
>
> Best regards from germany
>
> Klaus
>
>
>
>
>
5. VB6 ActiveX (OCX) Development: ActiveX tries to modify it磗 own label
6. Question about ActiveX Controls and ActiveX DLLs.
When is it best to use/create an OCX project versus an ActiveX DLL? I ask
this because I have a project (client side) that uploads and downloads files
using WinInet.
I have a VB front end (for testing and debugging). At the end of the day, I
want to automatically download the components to the client via the browser.
I understand and realize that IE browser security setting can hinder
installation, which is fine and we'll deal with "Digital Signing" at a later
date once we know all works well. However, I'm not sure whether to create an
OCX or DLL, and indeed "Which is Best".
As I'm still realativley new to this kind of thing, I've talked to other
peers and it seems that generally it is a "Developer Preferrence" as to the
direction to take.
I'm a little skeptical about this approach as I would think there would be
some "Accepted Practices or Guidelines" to determine the best course of
action.
I would appreciate some general direction.
TX.
7. VB6 ActiveX (OCX) Development: ActiveX tries to modify it乻 own label
8. VB6 ActiveX (OCX) Development: ActiveX tries to modify it磗 own label
Hi NG,
we have the following Problem:
We are developing an VB6- ActiveX that contains a form a label and a Module
with Sub.
The ActiveX- Form includes the label.
- From the ActiveX form I can access the label via "UserControl.label....".
- If we trie to access the label from Sub in the Module (the module is part
of the ActiveX) we have no access, the Syntax "UserControl.Label..." is not
possible it seemed that we have no access to this label.
- The same problem occurs if we have a class integrated in the ActiveX and
the class tries to modify the label.
What do we have to change that we can access the label.
Please note: We are not talking about the ActiveX- Interface to other
applications, the problem occurs internal in the ActiveX
Best regards from germany
Klaus