wxPython application window as a MDI Child of the VB MDIFrame

Hi,

I am working on wxPython application; I need to make the wxPython application a MDI Child in the VB MDIForm.

I have created a Python COM Application Server. I use CreateObject() in VB to start my wxPython Application. I use SetParent() in wxPython to make the MDIForm parent to wxPython application.

The application becomes a child to VB MDI Form but it does not behave like a normal MDI Child.

I tried using window Handler (Hwnd) of the VBMDIForm to create a wxWindow Object using wxWindow_FromHWND() function. And using this object as parent while creating a wxMDIChildFrame but it gave an error saying that the parent should be of type wxMDIParentFrame.

I want the wxPython application window to be a MDI Child of the VB MDIFrame.

Does anyone have a solution to this??

Dhruv

Dhruv Dhody wrote:

Hi,

I am working on wxPython application; I need to make the wxPython
application a MDI Child in the VB MDIForm.

I have created a Python COM Application Server. I use CreateObject()
in VB to start my wxPython Application. I use SetParent() in wxPython
to make the MDIForm parent to wxPython application.

The application becomes a child to VB MDI Form but it does not behave
like a normal MDI Child.

I tried using window Handler (Hwnd) of the VBMDIForm to create a
wxWindow Object using wxWindow_FromHWND() function. And using this
object as parent while creating a wxMDIChildFrame but it gave an
error saying that the parent should be of type wxMDIParentFrame.

I want the wxPython application window to be a MDI Child of the VB
MDIFrame.

Does anyone have a solution to this??

The wxMDI classes have interactions with each other so they need to be the real wx MDI classes. You might try creating the child frame in VB and then creating a child of that window in wxPython...

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Dhruv Dhody wrote:
> Hi,
>
>
>
> I am working on wxPython application; I need to make the wxPython
> application a MDI Child in the VB MDIForm.
>
> I have created a Python COM Application Server. I use CreateObject()
> in VB to start my wxPython Application. I use SetParent() in wxPython
> to make the MDIForm parent to wxPython application.
>
> The application becomes a child to VB MDI Form but it does not behave
> like a normal MDI Child.
>
> I tried using window Handler (Hwnd) of the VBMDIForm to create a
> wxWindow Object using wxWindow_FromHWND() function. And using this
> object as parent while creating a wxMDIChildFrame but it gave an
> error saying that the parent should be of type wxMDIParentFrame.
>
> I want the wxPython application window to be a MDI Child of the VB
> MDIFrame.
>
> Does anyone have a solution to this??
>

The wxMDI classes have interactions with each other so they need to be
the real wx MDI classes. You might try creating the child frame in VB
and then creating a child of that window in wxPython...

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

···

----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Friday, February 28, 2003 11:43 PM
Subject: Re: [wxPython-users] wxPython application window as a MDI Child of the VB MDIFrame

--------------------------------------------------------------------------------

Hi,

I have made the wxPython application a normal child of the MDI Form in VB. It is within the MDI Form, the problem is it does not behave properly when I maximize or minimize it. Here is a code snippet

wxPython Code:

class Dhruv:

    _reg_clsid_ = "{37F1DE73-2DE8-49A9-B5FB-794439E2C618}"

    _reg_desc_ = "Dhruv"

    _reg_progid_ = "Python.Dhruv"

    _reg_clsctx_ = CLSCTX_INPROC

    _public_methods_ = ['make']

    _public_attrs_ =

    _readonly_attrs_ =

    _reg_class_spec_ = "d.Dhruv"

    def make(self,hwnd1):

        self.app = wxPySimpleApp()

        self.frame1 = DoodleFrame1(None)

        self.frame1.Show(true)

        self.hwnd2 = win32gui.GetActiveWindow()

        self.hwnd1 = hwnd1

        a = win32gui.SetParent(self.hwnd2,self.hwnd1)

        self.app.MainLoop()

VB Code:

Private Sub Hi_Click()

    Dim a as Object

    Set a = CreateObject("Python.Dhruv")

    a.make MDIForm1.hWnd

    Set a = Nothing

End Sub

Is there anyway of creating a MDI Child Form in VB and embedding the canvas created in wxPython?

Thanks

Dhruv

--------------------------------------------------------------------------------