Skip to content

XSharp.VOGUIClasses throws an error if a DataWindow has a ShellWindow as owner #1324

@wriedmann

Description

@wriedmann

The DataWindow has the following code in the constructor:

        IF IsObject(oOwner)
            oObject := oOwner
            SWITCH oObject
            CASE App
                SUPER(NIL, FALSE)
                lTopApp := TRUE
                // lQuitOnClose := true
            CASE DialogWindow
                SUPER(oOwner, TRUE)
            CASE DataWindow
                // Create sub form if we're a regular DataWindow
                Default(@nResourceID, 0)
                lSubForm := (dwDialogStyle = 0)
                oDwOwner := oOwner
                SUPER(oOwner, FALSE, FALSE)
            CASE ChildAppWindow
            CASE TopAppWindow
                SUPER(oOwner)
            CASE Window
                // <XXX> invalid Owner - throw error
                WCError{#Init,#DataWindow,__WCSTypeError,oOwner,1}:Throw()
            OTHERWISE
                SUPER(oOwner)
            END SWITCH
        ELSE
            SUPER(oOwner)
        ENDIF

If you use as owner a class that is derived from ShellWindow, the WCError is thrown because the ShellWindow is inherited from AppWindow, and that directly from Window, so an error of "invalid owner" is thrown.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions