Bug in User Interface Process Application Block

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Luxspes (luxspes_at_yahoo.com)
Date: 03/15/04


Date: Mon, 15 Mar 2004 11:30:55 -0600

Hi!
I found a Bug in User Interface Process Application Block
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html
/uip.asp).
If you add a control that has a "MessageBox.Show" in its constructor to a
child modal form that inherits from WinFormView, the current view and
controller get out of sync.
You can seet if you add the following code to the WinFormViewManager:

   public bool IsRequestCurrentView( IView view, string stateViewName )
        {
            // Was Not implemented. Microsoft thinks that In a winform
applications isnīt necesary
   // but it is if some control calls MessageBox in its constructor in a
chid modal view...
   ViewSettings viewSettings =
UIPConfiguration.Config.GetViewSettingsFromName(stateViewName);
   if( viewSettings == null )
    throw new UIPException( Resource.ResourceManager.FormatMessage(
"RES_ExceptionViewConfigNotFound", stateViewName ) );

   string stateViewType = viewSettings.Type;
   System.Windows.Forms.Form form = (System.Windows.Forms.Form)view;
   string viewType=form.GetType().FullName;
   Debug.Assert(stateViewType.Equals( viewType ),stateViewType+" ==
"+viewType);
   return true;
        }

The assert fails!! this shouldn't happen! Any ideas in how to fix this?
thanks
bye
Luxspes



Relevant Pages

  • Re: MessageBox hangs app. AfxMessageBox
    ... You mentioned that popping up message boxes in the constructor is dicey. ... When I try to put up an AfxMessageBox or MessageBox, the app. ... Right click on the control and do "Add Variable" to get a control ...
    (microsoft.public.vc.mfc)
  • Re: LoadControl() and Constructor Parameters
    ... void Init. ... Page_Init phase as because if you do this on say, Page_Load, the control ... non-default constructor to work. ... also make the _Subcategory a public field and rename it to Subcategory, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to add a CWnd subclass object to a CDialog?
    ... // TODO: Add extra initialization here ... RECT rect; ... It is inappropriate to do this in a constructor. ... create two instances of this control, because it sets its placement in the constructor. ...
    (microsoft.public.vc.mfc)
  • Re: Querying components in ComponentTray.
    ... constructor taking an IComponent parameter. ... DataAdapter) are added to the System Tray and what would be the collection ... When you drop your control onto the System Tray, ... > When you drop this control on your form, the Windows Form designer should ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Querying components in ComponentTray.
    ... constructor taking an IComponent parameter. ... DataAdapter) are added to the System Tray and what would be the collection ... When you drop your control onto the System Tray, ... > When you drop this control on your form, the Windows Form designer should ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)