使用CBitmapButton::AutoLoad()的时候,
要求位图id 多重引用.怎样设置?

解决方案 »

  1.   

    AutoLoad就是你的位图在资源里面定义好了如IDC_BITMAPU,IDC_BITMAPF,IDC_BITMAPD,IDC_BITMAPX等你就可以用AutoLoad(IDC_BITMAP);以下来自msdn:To create a bitmap-button control in a window’s client area, follow these steps: Create one to four bitmap images for the button.Construct the CBitmapButton object.Call the Create function to create the Windows button control and attach it to the CBitmapButton object.Call the LoadBitmaps member function to load the bitmap resources after the bitmap button is constructed. 
    To include a bitmap-button control in a dialog box, follow these steps: Create one to four bitmap images for the button.
    Create a dialog template with an owner-draw button positioned where you want the bitmap button. The size of the button in the template does not matter.
    Set the button’s caption to a value such as “MYIMAGE” and define a symbol for the button such as IDC_MYIMAGE.
    In your application’s resource script, give each of the images created for the button an ID constructed by appending one of the letters “U,” “D,” “F,” or “X” (for up, down, focused, and disabled) to the string used for the button caption in step 3. For the button caption “MYIMAGE,” for example, the IDs would be “MYIMAGEU,” “MYIMAGED,” “MYIMAGEF,” and “MYIMAGEX.” You must specify the ID of your bitmaps within double quotes. Otherwise the resource editor will assign an integer to the resource and MFC will fail when loading the image.
    In your application’s dialog class (derived from CDialog), add a CBitmapButton member object.
    In the CDialog object’s OnInitDialog routine, call the CBitmapButton object’s AutoLoad function, using as parameters the button’s control ID and the CDialog object’s this pointer. 
    If you want to handle Windows notification messages, such as BN_CLICKED, sent by a bitmap-button control to its parent (usually a class derived from CDialog), add to the CDialog-derived object a message-map entry and message-handler member function for each message. The notifications sent by a CBitmapButton object are the same as those sent by a CButton object.
      

  2.   

    都设置好了,执行的时候就出现错误,在autoload那里出错
      

  3.   

    错误代号为107...winbtn.cpp...求解