摘要: C++/CLI中使用gcnew关键字表示在托管堆上分配内存,并且为了与以前的指针区分,用^来替换* ,就语义上来说他们的区别大致如下:1)gcnew返回的是一个句柄(Handle),而new返回的是实际的内存地址;2)gcnew创建的对象由虚拟机托管,而new创建的对象必须自己来管理和释放。当然,从程序员的角度来说,管它是句柄还是什么其他的东西,总跑不掉是对某块内存地址的引用,实际上我们都可以理解成指针。int^p1 = gcnew int(); 利用gcnew,可以不用程序员释放申请的资源;int* p1 = new int(); delete p1; 利用new, 程序员必须手动释放申请的 阅读全文
posted @ 2013-01-31 11:21 nchxmoon 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 1. How to use MSXML2 in C++?First, we should import the "msxml6.tlb" file, the code as below: #import "..\Common\msxml6.tlb" raw_interfaces_only exclude("ISchemaElement", "ISchemaAttribute")Then we can use the MSXML2 interfaces now, take for an example:CoIniti 阅读全文
posted @ 2013-01-28 17:38 nchxmoon 阅读(311) 评论(0) 推荐(0) 编辑
摘要: You can get the free vesion in the website: http://www.jetbrains.com/profiler/. 阅读全文
posted @ 2013-01-28 10:58 nchxmoon 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 在main()中写有内存泄露的代码,通过调用_CrtDumpMemoryLeaks(); 方法,在Debug模式下,输出窗口就可以检测到内存泄露! 阅读全文
posted @ 2013-01-25 17:38 nchxmoon 阅读(155) 评论(0) 推荐(0) 编辑
摘要: expression.Address(RowAbsolute, ColumnAbsolute, ReferenceStyle, External, RelativeTo)expression 必需。该表达式返回上面的对象之一。RowAbsolute Variant 类型,可选。如果为 True,则以绝对引用方式返回对行的引用。 默认值为 True。ColumnAbsolute Variant 类型,可选。如果为 True,则以绝对引用方式返回对列的引用。默认值为 True。ReferenceStyle XlReferenceStyle 类型,可选。XlReferenceStyle 可为以下 . 阅读全文
posted @ 2013-01-24 09:56 nchxmoon 阅读(435) 评论(0) 推荐(0) 编辑
摘要: Dim arr As Variant ReDim arr(3, 4) Dim row As Long Dim col As Long row = UBound(arr, 1) col = UBound(arr, 2) 阅读全文
posted @ 2013-01-22 13:11 nchxmoon 阅读(7510) 评论(0) 推荐(0) 编辑
摘要: 1. 开始执行以下命令: Subst b: %windir%\assembly .2. 执行完后,会发现硬盘分区多了个B盘,打开后看到了所有assembly下的DLL.3. 当这个虚拟的B分区不再需要,于是执行以下命令将其删除: Subst b: /d .4. 注册GAC: DOS下运行GACUTIL/I + dll path. 阅读全文
posted @ 2013-01-14 17:21 nchxmoon 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 很多时候,我们在选择循环的时候,会考虑用那个循环好一点,这个好一点就是指效果高一点!今天我对于for, foreach循环做了个性能测试,测试代码如下:// Performance test of for loop. private void ForLoopPerformance() { System.Diagnostics.Debug.WriteLine("ForLoopPerformance: ");string[] array = new string[10000000];DateTime d1 = DateTime.Now; for (int i = 0; i &l 阅读全文
posted @ 2012-12-31 17:32 nchxmoon 阅读(12883) 评论(1) 推荐(0) 编辑
摘要: 我们在写WPF控件的时候,经常会需要在xaml文件添加一些引用, 如System.Windows.Forms引用,但是在xaml文件没有提供类似于 using System.Windows.Forms; 的语法, 因此我们需要通过 xmlns关键字来添加引用。具体实现如下:xmlns:wf="clr-namespace:System.Windows.Forms; assembly=System.Windows.Forms"其中: wf为引用别名,在xaml文件中,可以用wf来代替该引用; clr-namespace:引用名字; assembly=引用对应的DLL名字 阅读全文
posted @ 2012-12-31 11:27 nchxmoon 阅读(3682) 评论(0) 推荐(1) 编辑
摘要: 分享一个“一起学习winphone7”系列课程,主讲:李振,感兴趣的朋友可以通过下面的链接下载!每一小节包括视频和例子!http://www.microsoft.com/china/msdn/events/webcasts/shared/webcast/Series/WP7.aspx 阅读全文
posted @ 2012-12-28 21:19 nchxmoon 阅读(174) 评论(0) 推荐(0) 编辑