Duplicated window class name

If have a containercontrol in a a window of class MyWindow (which is instantiated by simply showing it). Since this container control can be in more than one class of window, I’m trying to get which window it is embedded in with


but often the “truewindow” comes back as MyWindow.MyWindow, not just MyWindow.

I don’t understand what that means, or how to prevent it (because when I do a comparison, MyWindow <> MyWindow.MyWindow).

It’s telling you internals that you probably don’t need to know but have no way to avoid knowing
Windows are actually classes in a namespace with the same name as the window
Hence MyWindow.MyWindow

Hm, I can’t try at the moment, but can I cast my window as a MyWindow.MyWIndow and use the MyWindow class methods and properties?

I’ll confess I don’t follow what it is you’re trying to do (or why)
But here’s what I set up which may aid

  1. my app open event simply has
  1. window1 and window both have an instance of containerControl1 on them
  2. containercontrol1 has just a button with an action event in it that reads

if self.TrueWindow isA Window1 then msgbox "window1" elseif self.TrueWindow isA Window2 then msgbox "window2" end if

When I hit run I get two windows (window and window2)
Pressing the bevel button which is on each container embedded on each window at design time yield the correct “window1” or “window” message

If you need the container control to call methods in each window, use new event definitions to do that rather than calling the window directly. Then it won’t matter what the name of the parent window is, the window will handle the events.

Ah, Norman, you’re right. It does evaluate properly. Thanks to all for their replies.

Since you’re using implicit instantiation, a simple equals should still work, although it is much better to use ISA.

if self.truewindow = mywindow then