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

 

 ·小问题,    »显示摘要«
    摘要: 在sql server 中表的字段类型为char; 比如字段内容为 mm 在vc中用的是静态绑定变量类型为cstring; 比如是 m_1; 我用一个crecordset对象与这个表关联; crecordset *m_pset; 但是 if(m_pset->m_1=="mm")这个条件我用的时候为什么是否定呢? 也就是说m_pset->m_1不等于&quo......
 ·判断两个变量完全相等    »显示摘要«
    摘要: 在vb中如何判断两个变量的类型,数值完全相等? ......


求教几个常见的问题...

PeekMessage   和   GetMessage有什么区别?  
   
  new/delete   和   new[]/delete[]有什么区别  
   
  为什么dll中的函数要加   extern   "C"

NO.1   作者: xiaoshao_0_0

第一个问题:不知道  
  new[]/delete[]是删除数组用的,如:int   *p=new   int   [5];delete   []p;  
  dll   中的函数加extern   "C"是为了使它可以在c语言里调用  
  因为C++默认会对函数名作一些处理使得C程序不能正常调用它

NO.2   作者: stoneyrh

PeakMessage是检查消息队列中有没有消息,检查时,你可以删除其中的消息,也可以不删除  
  GetMessage则是从队列中取出消息,肯定会删除其中的消息的

NO.3   作者: zhujianping_es

Explain   one   by   one:  
  PeekMessage   和   GetMessage有什么区别?  
  ------------------------------------>  
        the   difference   lies   in   when   your   message   handler   is   a   time-consuming   function.  
  If   you   use   GetMessage()   then   your   programe   will   block   until   your   message   handler  
  returns.During   this   time   span   ,you   cant   interact   with   your   program.  
          PeekMessage   provide   a   way   to   solve   this   problem   by   this:Whenever   a   message    
  comes,it   supsend   your   time-consuming   functions   excuting   and   process   the   message.  
  So   you   could   interact   with   your   program.  
  new/delete   和   new[]/delete[]有什么区别  
            new[]/delete[]   is   the   same   with   new/delete   except   that   it   is   delete   the    
  memory   alloc   for   arrays!  
            while   new/delete   merely   deals   with   a   structure,new[]/delete[]   deals   with  
  arrays(could   also   be   structure   arrays)  
  为什么dll中的函数要加   extern   "C"  
              when   you   create   a   MFC   dll,the   C++   compiler   will   add   a   extreme   long   name   for  
  each   of   your   export   function.To   avoid   this,add   extern   "C"   like   this;  
 

NO.4   作者: BinaryPoet

PeekMessage和GetMessage唯一的区别是:取得下一条消息之后,如果IDLE,是不是进行进程调度。

NO.5   作者: fang_jb

1、Unlike   the   GetMessage   function,   the   PeekMessage   function   does   not   wait   for   a   message   to   be   placed   in   the   queue   before   returning.  
   
  2、new/delete和new[]/delete[]都是内存操作,后者是用来分配数组的  
   
  3、DLL中加extern   C是为了告诉编译器使用C风格生成编译后的函数符号名,不同的编译器对于C++函数编译之后的函数名是不同的,而DLL的目的是可以让别的程序调用,于是要求有一个统一的风格,SO,使用extern   C


    摘要: 我最近再做一个网页,需要实现当在一个下拉选框中选中一个值后,能够使其他的文本框或者选择框变灰,使其不能接受输入! 急盼! ......
» 本期热门文章:

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