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

 ·错误    »显示摘要«
    摘要: {"the connectionstring property has not been initialized." } 是哪里有错误? ......
 ·分区中如何设置自增字段    »显示摘要«
    摘要: 小弟现已把表分为12个月,check约束时间字段按月分的,现在的问题是我想加入自增字段,该字段是int型,请问我该如何加,加的时候要注意哪些地方,该试图有instead of触发器 ......


一个不明白的地方

在一本VC的书中有这样的一个例子:  
  首先实例化一个字体对话框CFontDialog的对象FtDlg,再建立一个CFont类型的变量m_font,然后在菜单项的命令响应函数中加入代码:  
   
  m_font.CreateFontIndirect(FtDlg.m_cf.lpLogFont);  
  m_strFontName=FtDlg.m_cf.lpLogFont->lfFaceName;  
  Invalidate();  
   
  最后在View类的OnDraw()函数中使用选择的字体类型和大小输出字体的名称,当重复点击菜单项时出现非法操作,书上的解释是CFont的m_font对象已经关联了一个字体资源,所以当再次进入这个命令响应函数时会发生非法操作,我对于这个解释很不理解,为什么说CFont对象关联了一个字体资源?这句话是什么意思???

NO.1   作者: happyparrot

When   you   finish   with   the   CFont   object   created   by   the   CreateFontIndirect   function,   first   select   the   font   out   of   the   device   context,   then   delete   the   CFont   object.  
   
  CFont   font;  
  LOGFONT   lf;  
  memset(&lf,   0,   sizeof(LOGFONT));               //   zero   out   structure  
  lf.lfHeight   =   12;                                             //   request   a   12-pixel-height   font  
  strcpy(lf.lfFaceName,   "Arial");                 //   request   a   face   name   "Arial"  
  VERIFY(font.CreateFontIndirect(&lf));     //   create   the   font  
   
  //   Do   something   with   the   font   just   created...  
  CClientDC   dc(this);  
  CFont*   def_font   =   dc.SelectObject(&font);  
  dc.TextOut(5,   5,   "Hello",   5);  
  dc.SelectObject(def_font);  
   
  //   Done   with   the   font.   Delete   the   font   object.  
  font.DeleteObject();  
 


 ·有空进来看看    »显示摘要«
    摘要: 我有一个表xx(cbbh,jlsj,hc,jin,wei,qxdm,usecode,isnew),里面的数据可能有上亿条,并且每天增长速度非常的大(日增长大约会是二三万条),实表中部份数据贴出如下: id cbbh jlsj wei qxdm usecode isnew 1 zy00085 2005-8-26 9:53:09 110.264236450195 080101 st0007......
» 本期热门文章:

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