请问VC里资源的ID号有什么用?
谢谢

解决方案 »

  1.   

    当然有用啊~你可以通过控件的ID号获取控件的句柄啊!
    /*------------------------------------------------------------------*/
    VC驿站 - WwW.CcTry.CoM
    C、C++、VC++ 编程学习 免费课程 精品电子书 精品源码 下载 期待您的加入!
    /*------------------------------------------------------------------*/
      

  2.   

      In   windows  
      #define   void*   HANDLE   and   ID   is   the   short   for   Identifier(身份).  
      In   fact   HANDLE   don't   need   to   exist   if   you   just   program   with   VC++.You   can   always   use   pointer.   But   Microsoft   doesn't   think   so,   so   you   must   use   HANDLE   some   time.   Generally,   you   use   this   HANDLE   to   obtain   the   pointer   of   the   object,   because   HANDLE   is   the   physical   address   of   a   object.   ID   is   just   the   identifier   of   a   resource   such   as   a   bitmap   or   a   dialog   template,   the   purpose   it   to   tell   the   VC++   compiler   that   you   are   using   this   bitmap   or   dialog.
      

  3.   

    摘自msdn,其实我也是初学vc,呵呵
      

  4.   

    ID这个身份号就是一个整型数,对应着一个资源,用这个ID时就是指定了这个资源。一个资源就有一个ID,但是不同的资源可以有相同的ID, 比方一个菜单项和一个工具条按钮就可以使用同样的ID,用户点击时都可以指向同一个响应函数。