zip's

while(true) { Write it down; Think about it; Refine it; Sleep(); }

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2011年6月8日

摘要: 通常需要:1,设置窗口的父子关系;2,确定弹出窗口的初始显示位置; void CMainFrame::OnDoSomething() { WndWpf^ wnd = gcnew WndWpf(); WindowInteropHelper^ wndHelper = gcnew WindowInteropHelper(wnd); IntPtr ptr(this->GetSafeHwnd()); wnd... 阅读全文
posted @ 2011-06-08 17:35 zip's 阅读(1086) 评论(0) 推荐(0) 编辑

摘要: chm文件本质上就是个压缩文件,使用7z压缩软件就可以open Archive, 看到所有的这些内容。 如果想用代码读取,要知道 topic 和 subtopic : this.webBrowser1.Navigate("mk:@MSITStore:E:\\xxx.chm::/xxx_aa.htm"); - 阅读全文
posted @ 2011-06-08 15:47 zip's 阅读(305) 评论(0) 推荐(0) 编辑

摘要: To instrument a binary using the command-line tools http://msdn.microsoft.com/en-us/library/aa985635.aspx 链接的文档中有个错误,第4步中,start:/trace 应该是 /start:trace 使用 IDE 时,总是出现 “The process cannot access the f... 阅读全文
posted @ 2011-06-08 15:36 zip's 阅读(312) 评论(0) 推荐(0) 编辑

摘要: 比如你的.net程序分配了很多内存,即使某些对象不需要了,但是由于各种原因,垃圾回收不能将其回收,这也是内存泄漏,如何避免,阅读:How to detect and avoid memory and resources leaks in .NET applications 阅读全文
posted @ 2011-06-08 15:28 zip's 阅读(186) 评论(0) 推荐(0) 编辑

摘要: 在无法设置断点或数据量巨大的情况下,将程序运行状态输出到磁盘文件后进行分析是个有效的方法。如果数据较少,可以直接通过设置断点的“when hit...” 向 output 窗口输出。 using namespace System; using namespace System::IO; String^ s = gcnew String("written by yapzhang"); FileStr... 阅读全文
posted @ 2011-06-08 15:22 zip's 阅读(310) 评论(0) 推荐(0) 编辑

摘要: 在升级版本后,新版本读取旧版本文件时,程序崩溃,在调试时可以先简化数据,步骤是: 1, 用老版本软件打开这个文件,简化文件内容, 保存 2, 用新版本软件打开 3, 重复步骤1和2, 直到找到兼容有问题的对象, 再设断点跟踪 这里宗旨就是,把问题先最简单化 阅读全文
posted @ 2011-06-08 15:17 zip's 阅读(144) 评论(0) 推荐(0) 编辑

摘要: 最简单的方法是 System.Windows.Forms.NotifyIcon public partial class MainWindow { public MainWindow() { InitializeComponent(); // show in system tray this.ShowInTaskbar = false; NotifyIcon ni = new NotifyIcon... 阅读全文
posted @ 2011-06-08 15:04 zip's 阅读(716) 评论(0) 推荐(0) 编辑

摘要: 1、K28.5+/- K28.5是测量光纤通道和工作在1Gb/s到3.125Gb/s以太网系统抖动通常指定的序列模板,该序列是8B/10B译码表中的一个特殊字符,经常表示一帧的开始或结束。重复的K28.5序列(轮流由K28.5+和K28.5-构成)含有数据串0011111010110000010,它有五个连续的1和五个连续的0(8B/10B译码数据中最长连续同样数字),它还含有分开的1-010和0... 阅读全文
posted @ 2011-06-08 14:43 zip's 阅读(990) 评论(0) 推荐(0) 编辑

摘要: 可以处理进度,完成通知 mworker = new BackgroundWorker();mworker.DoWork += new DoWorkEventHandler(OnWork);mworker.WorkerReportsProgress = true;mworker.ProgressChanged += new ProgressChangedEventHandler(OnWork... 阅读全文
posted @ 2011-06-08 14:39 zip's 阅读(492) 评论(0) 推荐(0) 编辑

摘要: 原文链接:WPF Apps With The Model-View-ViewModel Design Pattern 要点:M-V-VM 是建立在 WPF 平台上,若不是用 WPF ,则该模式不适用。利用 WPF data binding/command binding 实现,数据与 UI 完全分离。最大的卖点之一是对UI可以进行 unit test,因为 UI 只是对 ViewModel 的 b... 阅读全文
posted @ 2011-06-08 14:35 zip's 阅读(124) 评论(0) 推荐(0) 编辑

摘要: 在MFC wizard生成的MDI程序里,观察生成的资源,对于 Cut 操作,绑定了 VK_DELETE 键。也就是说,当按下 delete 键时,会进入到 ID_EDIT_CUT 事件的响应函数中去 IDR_MAINFRAME ACCELERATORS BEGIN VK_DELETE, ID_EDIT_CUT, VIRTKEY, NOINVERT "X", ID_EDIT_CUT, VIRTKE... 阅读全文
posted @ 2011-06-08 14:30 zip's 阅读(285) 评论(0) 推荐(0) 编辑

摘要: 如果你的 MFC 程序调用 dll ,并且遇到与 handle 相关的错误,多数可以通过这两个宏来解决。简单的讲,每个模块,exe 或者 dll, 都模块内维护了一些状态,例如:句柄map,当使用句柄时,必须切换至正确的模块状态。一个常见的问题是,你的 exe 调用 dll 中一个 function,function 创建一个对话框,可是这个对话框怎么也创建不出来。这是因为,定义对话框的资源ID都... 阅读全文
posted @ 2011-06-08 14:21 zip's 阅读(259) 评论(0) 推荐(0) 编辑

摘要: 在MFC窗口中嵌入WPF控件时 Transparency settings. A top-level window can be configured to blend with the other windows on the desktop according to the per-pixel transparency of the WPF content. To enable this, s... 阅读全文
posted @ 2011-06-08 11:33 zip's 阅读(1168) 评论(0) 推荐(0) 编辑

摘要: 如何设置每次滚动多少? 1,点击向上、向下按钮时,由 ScrollBar.SmallChange 决定; 2,点击 repeat button 时,由 ScrollBar.LargeChange 决定; 3,拖动 thrum 时,根据 thrum 的像素位置,转换到 [Minimum, Maximum] 区间; 阅读全文
posted @ 2011-06-08 11:29 zip's 阅读(333) 评论(0) 推荐(0) 编辑

摘要: 更改坐标原点 通过 ScaleTransform 加上 TranslateTransform 来完成,下面的例子中是一个 1000 乘 1000 大小的 Canvas, 希望将其坐标原点移到中心,就是 500,500 处 <Canvas Height="1000" Width="1000"> <Canvas.Resources> <Style TargetType="{x:Type TextBlo... 阅读全文
posted @ 2011-06-08 11:04 zip's 阅读(1138) 评论(0) 推荐(0) 编辑

摘要: 直接 cast 即可 System::String^ s1 = gcnew System::String("How easy!");CString s = (CString)s1; 看 CStringT 的源代码,CStringT 中有一个传入 System String 的构造函数: // This template will compile only for // class SystemSt... 阅读全文
posted @ 2011-06-08 10:55 zip's 阅读(1683) 评论(0) 推荐(0) 编辑

摘要: SICL Agilent Standard Instrument Control Library (SICL) is an I/O Library developed by Agilent (HP) that is portable across many interfaces and systems. SICL is a modular instrument communications lib... 阅读全文
posted @ 2011-06-08 10:43 zip's 阅读(1200) 评论(0) 推荐(0) 编辑