- wxFrame *frame = wxDynamicCast(win, wxFrame);
- if ( frame && !frame->IsMDIChild() )
+ wxFrameMSW *frame = wxDynamicCast(win, wxFrame);
+ if ( frame
+#if wxUSE_MDI_ARCHITECTURE
+ && !wxDynamicCast(frame, wxMDIChildFrame)
+#endif // wxUSE_MDI_ARCHITECTURE
+ )