ff
错误信息:详细信息:检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80070005。
网上找到的解决方案:
 运行dcomcnfg打开组件服务,
依次展开"组件服务"->"计算机"->"我的电脑"->"DCOM配置"
找到"Microsoft Excel应用程序"或"Microsoft Word应用程序",
右键打开属性对话框,点击"标识"选项卡,
选择"启动用户"
点击"安全"选项卡,
依次把"启动和激活权限","访问权限","配置权限",都选择为自定义,
然后依次点击它们的编辑,把everyone添加进去,并加入所有的权限
 http://topic.csdn.net/u/20090130/15/b64879fc-3dab-48f7-846e-908e17af8bc6.html
posted @ 2011-07-26 11:31 人在旅途,前行 阅读(44) 评论(0) 编辑
<script type="text/javascript">
        
function doTest(s) {
            document.writeln(s 
+ " : " + eval(s) + "<br />");
        }

        doTest(
"null==undefined");         //1:null==undefined : true                     
        doTest('null==""');             //2: null=="" : false                          
        doTest('null==0');                 //3: null==0 : false                           
        doTest('0==""');                 //4: 0=="" : true                             
        doTest('false==0');             //5:false==0 : true                            
        doTest('false==""');             //6: false=="" : true                          
        doTest('true==0');                 //7:true==0 : false                            
        doTest('true==1');                 //8:true==1 : true                             
        doTest('true==-1');             //9: true==-1 : false                          
        doTest('false==null');             //10:false==null : false                        
        doTest('');                     //11: : undefined                            
        doTest('false==undefined');     //12:false==undefined : false                   
        doTest('-0===+0');                 //13:-0===+0 : true                        
        doTest('-0==+0');                 //14:-0==+0 : true                             
        doTest('-(-0)===0');             //15:-(-0)===0 : true                           
        doTest('false===(!true)');         //16:false===(!true) : true                       
        doTest('typeof(null)');         //17:typeof(null) : object                        
        doTest('typeof(false)');         //18:typeof(false) : boolean                      
        doTest('typeof(undefined)');     //19:typeof(undefined) : undefined                
        doTest('typeof(1)');             //20:typeof(1) : number                         
        doTest('typeof(+1.1)');         //21:typeof(+1.1) : number                      
    </script>
posted @ 2009-12-10 16:28 人在旅途,前行 阅读(57) 评论(0) 编辑

WinForm中ComboBox的DrawItem事件的应用

2008年11月24日 2,208 Views

今天在CSDN的论坛看到一个问题,大致是这么个意思:
当鼠标滑过ComboBox的列表项时,怎么才能获取当前鼠标滑过列表项?

在网上找了找,没现成的,但是看到有人在VC里边用OnDrawItem来实现,就用了这个思路。
首先将将DrawMode属性设置为OwnerDrawFixed
然后绑定DrawItem事件,具体方法如下:

  1. private void moveComboBox1_DrawItem(object sender, DrawItemEventArgs e)
  2. {
  3.             //经测试,鼠标划过时,e.State 为 DrawItemState.Selected
  4.             if (e.State == DrawItemState.Selected)
  5.             {
  6.                 e.Graphics.FillRectangle(new SolidBrush(Color.Beige), new RectangleF(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height));
  7.                 //显示鼠标滑过项目的文本
  8.                 label1.Text = moveComboBox1.Items[e.Index].ToString();
  9.             }
  10.             else if (e.State == DrawItemState.None)
  11.             {
  12.                 e.Graphics.FillRectangle(new SolidBrush(Color.White), new RectangleF(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height));
  13.             }
  14.  
  15.             e.Graphics.DrawString(moveComboBox1.Items[e.Index].ToString(), moveComboBox1.Font, new SolidBrush(Color.Black), 2, e.Bounds.Y + 2);
  16. }
posted @ 2009-07-02 11:39 人在旅途,前行 阅读(314) 评论(0) 编辑