CButton mybtn[301*33];for ( int i=0; i<301*33; i++ )
{
  mybtn[i].Create(...);
  if ( mybtn[i]==NULL )
  {
      ...// create wrong
      break;
  }
}this count, cann't create all the buttons, at last, will go into if
but use
CButton mybtn[300*33];
for( int i=0; i<300*33; i++ )
{  ...
}
It's ok. So the count of the buttons is not more than a largest number, is it really?

解决方案 »

  1.   

    你在create中的最后一个参数id值出问题了吧?
    你是怎么分配id值的?估定是id已被用了。
      

  2.   

    你建多少button你就要建多少个id
      

  3.   


    #define BUTTON_BEGIN 150000then create buttons:
    ...
    for(int i=0;...)
    {
      btn[i].Create(..., BUTTON_BEGIN+i);
    }I look for the other's resource, none is more than 150000.
    I modify the 150000 to 1500000, it's not correct too.
      

  4.   

    大多数情况下,是由于你把这个CButton类的数组建在栈上,造成了栈溢出造成的.
      

  5.   

    好象最多只能创建9900左右个子窗口,具体数目还是问Microsoft吧。顺便问一下,你创建那么多按钮有什么用?99.9999%的程序大概用不着那么多个子窗口。
      

  6.   

    you really need so many fucked button??!!
    what wrong with your brain??
    I never seen a shit american like you!
      

  7.   


    How do I?
    If I create static lable, could I create more than 10000?This is for telephone system,please help me
      

  8.   

    I needn't so many fucked button, but program need
      

  9.   

    msdn:CreateWindow
    .....
    Windows 95: The system can support a maximum of 16,364 window handles.That is, create button on a window can more than 10000. But I'm wrong when create buttons..... Don't know how do
      

  10.   

    Please draw these fucked button by youself.
    Don`t use MsfuckClass to create these buttons.
    best wish.
      

  11.   

    Draw these fucked button by myself?Oh, my god! A lot of buttons I should manage, I think this is not a  best way
      

  12.   

    对于你的程序来说,创建1万个button控件不现实。
    自己画按钮并处理鼠标事件应该是最好的方法,简单,且效率会提高很多。
      

  13.   

    As previous, This is for telephone system.Self draw the button, no, because it must have text on the buttons, and text on evey button perhaps not same and the back ground color is not same too.
    I think I can declare two group buttons variant and create every group button are same style, this doing can more than 9900, ok?
      

  14.   

    使用button控件只是为了简化程序的处理过程。每个button控件都是一个窗口,都要消耗一定的系统资源。无论如何也不应该,也不可能创建出这么多窗口。按你程序的要求,在一个主窗口上画出按钮并做相应处理很容易实现。
    如需要,我可以给你发一个示例程序(SDK)。
      

  15.   

    Oh, I seeI modify the project have a try
    and long time to do
      

  16.   

    Your English Is Very Good.