CMiniFrameWnd Mn;
RECT rc={400,100,200,100};
if(!Mn.Create(NULL,"Mini",MFS_MOVEFRAME,rc,NULL,0))
AfxMessageBox("Can't Create The Window");
编译的时候没问题
执行的时候系统非法操作了
为什么阿

解决方案 »

  1.   

    别的没看,你的RECT初始化的数据怎么会是这样?right和bottom相等(100),左侧比右侧大,这个窗口肯定不存在嘛编译的时候系统不知道该RECT的数值,当然可以通过,产生的时候就不行了具体请参考MSDN中的RECT定义
      

  2.   

    不好意思,上面笔误,应该是你将top和bottom设为相等了。顺便把RECT的定义拷贝如下:
    typedef struct _RECT { 
      LONG left; 
      LONG top; 
      LONG right; 
      LONG bottom; 
    } RECT, *PRECT; 其中:
    left 
    Specifies the x-coordinate of the upper-left corner of the rectangle. 
    top 
    Specifies the y-coordinate of the upper-left corner of the rectangle. 
    right 
    Specifies the x-coordinate of the lower-right corner of the rectangle. 
    bottom 
    Specifies the y-coordinate of the lower-right corner of the rectangle.
      

  3.   

    Members
    left 
    Specifies the x-coordinate of the upper-left corner of the rectangle. 
    top 
    Specifies the y-coordinate of the upper-left corner of the rectangle. 
    right 
    Specifies the x-coordinate of the lower-right corner of the rectangle. 
    bottom 
    Specifies the y-coordinate of the lower-right corner of the rectangle.
      

  4.   

    CMiniFrameWnd *Mn;
    Mn = new CMiniFrameWnd();
    RECT rc={400,100,200,100};
    if(!Mn->Create(NULL,"Mini",MFS_MOVEFRAME,rc,NULL,0))
    AfxMessageBox("Can't Create The Window");