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

 

    摘要: 我用setup factory6.0 打包我的vb程序 打包后的运行程序是 record.exe 当我运行它一次以后如果我再想 卸载(删除)它时 提示我: 删除文件或文件夹时出错 《-----这是标题 无法删除record.exe;拒绝访问。源文件可能正被使用。 这是怎么回事呢???我怎么做才能解决这个问题啊?? 谢谢 ......
 ·郁闷ing.....    »显示摘要«
    摘要: 昨天发高烧,今天发现五笔不会打了,ft 打一百个字有40个会打错,被烧坏了脑子? 郁闷。。。。。。 ......


一个关于重载的问题

我在重载"<<"的时候遇到一个问题,程序代码如下:  
  bcb6中编译    
  template<   class   T   >  
  class   LinearList  
  {  
  friend   ostream&   operator<<(ostream&   out,const   LinearList&   list);  
  public:  
  //--------------------------------  
  private:  
          T*   element;  
  };  
     
  template<class   T>  
  ostream&   operator   <<(ostream&   out,   const   LinearList<T>&   list)  
  {  
          for(int   i   =   0;   i   <   length;   i++)  
                  out<<list.element[i]<<"   ";  
              return   out;  
  }  
  可是编译不能通过,出现如下错误提示:  
  [Linker   Error]   Unresolved   external   operator   <<(_STL::basic_ostream<char,   _STL::char_traits<char>   >&,   const   LinearList<char>&)   referenced   from   E:\MYWORKS\CBPROJECTS\LITTLEAPPLES数据结构_抽象数据描述\MY_LINEARLIST\LINEARLIST_MAIN.OBJ  
  我不知道到底错在哪儿了:。。。。。

你的程序在VC.NET上可以通过。

NO.2   作者: Caoyu015

我忘了说我上面说的在VC   6.0中是行不通的,原因:VC   6.0对标准的支持很差。  
  在   VC.NET   和   BCB   以及DEV-CPP中都可以顺利编译.   如果你用的是VC   6.0就换个支持标准的C++编译器吧!  
  #include<iostream>  
   
  using   namespace   std;  
   
  //   forward   declare  
   
  template<   class     T   >   class     List;  
   
  //   forward   declare  
  template<   class     T   >  
  ostream&         operator<<   (   ostream&     os,   List<   T   >     &List   );  
   
  template<class   T>  
  class   List  
  {  
  friend   ostream&   operator<<   <   T   >(ostream&   os,   List<T>&   list);  
  public:  
  List()  
  {  
  char*   a   =   "I   love   you";  
  element   =   new   T[10];  
  for(   int   i   =   0;   i   <   10;   i   ++   )  
  element[i]=a[i];  
  }  
   
  ~List()  
  {  
  delete[]   element;  
  }  
   
  private:  
  T*   element;  
  };  
   
  template<class   T>  
  ostream& operator<<   (ostream&   os,   List<T>&   list)  
  {  
  for(int   i   =   0;   i   <   10;   i++){    
                          os<<list.element[i];  
                    }  
  return   os;  
  }  
   
  //   Drive   file:    
  #include   <iostream>  
  #include   <stdlib.h>  
  #include"CSDn_Qu1.h"  
   
   
  using   namespace   std;  
   
  int main()  
  {  
  List<char>   alist;  
  cout<<alist;  
  return 0;  
  }  
   
   
 


 ·我得到了一个internet explorer    »显示摘要«
    摘要: 我得到了一个internet explorer_server类型的窗口句柄。就是ie页面的句柄。我现在想通过这个句柄来取得这个页面的iwebbrowser2接口。或是ihtmldocument2接口。我该怎么做呢?? 原先thinkx(思考中)提供的方法只能得到explorer 和 internet explorer 但是如果我用的浏览器不是ie就没办法了。 我现在用的是myie 我想得到......
» 本期热门文章:
· 热门栏目:
» 相关精选文章
» 其它相关:

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