当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: 在一个很一般的学校,读了一年软件工程硕士,感觉没有什么收获,在学校做的项目很乱,学费还在催交(好多钱啊),想辍学,又觉的浪费了很多时间和金钱以及机遇,请大家给些意见,谢谢! ......
    摘要: xp系统安装的是.net 1.1,加入net组件treeview后,设置了nodes,但显示的却是没有分层次的树,就是连续的文本显示,不知为何,请赐教。 ......


请高手给我讲一讲这段程序是怎么得出结果的多谢

将当前驱动器加入到Tree中.其中   m_tree   为树.  
   
  //函数功能:获取驱动器  
  //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  
  void   CTreeViewDlg::GetLogicalDrives(HTREEITEM   hParent)  
  {  
          size_t   szAllDriveStrings   =   GetLogicalDriveStrings(0,NULL);  
  char   *pDriveStrings   =   new   char[szAllDriveStrings   +   sizeof(_T(""))];  
  GetLogicalDriveStrings(szAllDriveStrings,pDriveStrings);  
  size_t   szDriveString   =   strlen(pDriveStrings);  
  while(szDriveString   >   0)  
  {  
  m_tree.InsertItem(pDriveStrings,hParent);  
  pDriveStrings   +=   szDriveString   +   1;  
  szDriveString   =   strlen(pDriveStrings);  
  }  
  }  
   
  GetLogicalDriveStrings这个函数我明白了,就是不不明白在WHILE循环里面怎么一个一个的取出盘符的.  
  多谢!

NO.1   作者: yifengling0

The   GetLogicalDriveStrings   function   fills   a   buffer   with   strings   that   specify   valid   drives   in   the   system.  
   
   
  DWORD   GetLogicalDriveStrings(  
      DWORD   nBufferLength,  
      LPTSTR   lpBuffer  
  );  
   
  Parameters  
  nBufferLength    
  [in]   Maximum   size   of   the   buffer   pointed   to   by   lpBuffer,   in   TCHARs.   This   size   does   not   include   the   terminating   null   character.   If   this   parameter   is   zero,   lpBuffer   is   not   used.    
  lpBuffer    
  [out]   Pointer   to   a   buffer   that   receives   a   series   of   null-terminated   strings,   one   for   each   valid   drive   in   the   system,   that   end   with   a   second   null   character.   The   following   example   shows   the   buffer   contents   with   <null>   representing   the   terminating   null   character.    
  c:\<null>d:\<null><null>  
   
   
  返回的结构是这样的,你就很容易看出来是怎么实现的了,通过指针移动


 ·回来了,就多放点分    »显示摘要«
    摘要: rt ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE