Posted in 2007
AutoComplete with DataSource
- 06 August 2007
Download Sample code: jiangsheng/Samples
.Net 2.0 introduced autocompletion in TextBox and ComboBox. It is obvious that autocomplete is not very useful when the number of options is small. However, when the number of option becomes too many, pre-filling of all options to an AutoCompleteStringCollection becomes impractical, especially when the data is coming from a remote computer. An alternative is to replace the AutoCompleteCustomSource in a TextChanged event, however, users are getting random AccessViolationException when trying to replace it. In this article I will demonstrate another alternative, using a BindingSource as the data source of options, bypassing the .Net Framework and call the underline Windows API directly.
Visual C++ 2008 Beta2 里面的Class Designer
- 30 July 2007
Visual Studio 2008 Beta2中的Class Designer终于支持C++了,上面是一个MFC程序的类图,可以看到已经支持扩展MFC的宏了,可惜只能看不能重构代码。尽管Class Designer这功能相当不错,但是设计师们可能还是更习惯IBM 的Rational Rose Developer for Visual Studio和UML。我用Class Designer的C#支持的时候也就是加加注释而已,重构我更习惯用DevExpress提供的工具Refactor来做,类则用XSD.exe生成,因为Class Designer生成的属性只会扔NotImplementedException异常。
CSDN Tags: C++, Class Designer, Visual Studio 2008, Rational Rose, UML, C#, DevExpress, Refactor
Visual C++项目组在做下一个版本的市场调查,有兴趣的可以去提提要求。
Handle NewWindow3 and ShowModalDialog in CHtmlView
- 03 July 2007
CHTMLView does not support NewWindow3 as of MFC 9.0. It is relatively easy to add this support, given the event sink code in atlmfcsrcviewhtml.cpp
Add the following into the declaration of the derived CHtmlView class (named CHtmlViewTestView in this example)
Skew detection and correction resources
- 01 June 2007
http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm a nice introduction of the Hough Transform
http://www.leptonica.com/papers/docskew.pdf A paper discussing different skew detection methods
STL/CLR, Compiler and Marshaling
- 12 April 2007
MSDN第9频道又采访了Visual C++类库组的项目经理Nikola Dudar和Sarita Bafna,以及质量控制组的Marina Polishchuk。尽管Visual C++项目组已经转移了工作重点,但是很少人注意到这一点。或许这些采访可以帮助你了解Visual C++项目组的工作。 为什么C++仍旧重要?
非托管的应用程序有很大的代码积累,而这些程序的升级工作仍旧在进行
性能是选择C++的重要因素。举例来说,游戏和杀毒程序更适合用非托管代码来编写。
多平台支持。虽然.Net号称是跨平台的,但是如果要编写真正的跨平台程序,开发的时候遵循C++标准还是很有必要的。
为什么C++程序员仍旧重要?
C++程序员理解整个机器的运作,他们知道怎么写垃圾收集机制,甚至可以写机器代码
C++程序员可以很容易的学会其他语言——C++已经是最难学的语言之一了
C++程序员并不只使用一种语言。如果有必要的话,他们会选择汇编、C#或者Perl这样更适合特定任务的语言。
为什么Visual C++项目组转移了工作重点?
C++程序员对于转到C#没有抵触心理,所以Visual C++项目组不认为有必要尽快实现Visual C#支持的所有特性,比如LINQ和WPF设计器
C++程序员对于让他们的非托管程序调用其他语言的托管代码比用C++来写托管代码更有兴趣
核心模块,例如IE和Windows外壳会更加频繁地更新,而会有更多的非托管代码需要调用这些新的特性,为了这些特性,有必要在MFC中引入新的封装类来节省C++程序员的时间
Orcas中Visual C++的新特性:
托管代码互操作库。可扩展的托管数据类型和非托管数据类型的转换支持
STL/CLR。使得托管代码可以利用旧的STL编写的算法
Vista支持。对Vista中新的通用控件和文件对话框等界面元素的MFC封装。
DevExpess重构引擎——将包含DevExpess的Refactor!™ for C++。
Orcas之后的考虑
更新界面。有些Visual C++的代码是针对20年之前的硬件环境设计的,已经不适合现在的需要。新的Phoenix编译引擎使得重写前台变得更加容易。
太多现有的代码需要重构。新的Phoenix编译引擎使得代码分析变得更加容易。
C++标准。新的C++标准TR1可能会在Orcas下一版本开发时成为正式标准。
多核支持。需要编写可以充分利用多CPU的代码。第一个尝试是LINQ。
结论
MFC和非托管代码回来了
性能和多平台支持的重要性越来越低,托管代码仍旧具有很大的市场。
Visual C++项目组的其他动作
ATL Server发布到了源代码共享站点CodePlex。这包含CAtlRegExp,在.Net和第三方类库(boost,TR1)的竞争下已经不再有必要维护一个单独的条件表达式标准了
McDonald’s, Yum! Alleged To Break Chinese Wage Laws
- 29 March 2007
McDonald’s and Yum! Brands, the owner of KFC and Pizza Hut were the targets of an undercover investigation made by New Express Daily reporters.
Memory Leak in the Internet Explorer WebBrowser Control
- 28 February 2007
For automated applications such as parsers, the WebBrowser control may not be appropriate. Under IE4 there were several memory leak problems manifested when the control was repeatedly instantiated and destroyed and also, on occasions, when the control was merely navigated from page to page. Almost all of these problems were fixed and incorporated in the IE5 release. However new memory leaks were introduced in the script engine, the URL navigation history, and the security system. There is no word at this time on when these problems will be fixed. Unfortunately, some leaks ( the travel log that enable you to go back, for example) have been declared to be “by design” by the development team. For those applications where this is not possible it may be necessary for the customer to use a WebBrowser control from a non-Microsoft vendor that is designed for the type of long term continuous real-time activity that your are developing for.
If you need a similar interface, try the Mozilla ActiveX Control (I know little about it, so I am not sure it leaks memory or not) at https://web.archive.org/web/20010920144243/http://www.iol.ie/~locka/mozilla/control.htm. Apparently, you need to have Mozilla installed to use this Activex control. A hosting sample can be found at https://web.archive.org/web/20030422065641/www.codeproject.com/useritems/iemozilla.asp .
MIcrosoft MVP again
- 01 January 2007
祝贺您!我们非常高兴向您授予 2007 Microsoft® MVP 大奖!
您为世界各地的社区做出了巨大贡献,我们通过 Microsoft MVP 大奖对您表示感谢、敬意和鼓励。作为 Microsoft“最有价值专家”(Most Valuable Professional) 奖的得主,您成为全球技术社区领导者精英群体中的一员,该群体与用户和 Microsoft 积极分享实际工作的专业技能,促进了知识的自由、客观交流。Microsoft 向所有不断努力促进社区发展、提升人们生活质量和促进行业成功的 MVP 们表示崇高的敬意。要了解有关 MVP 计划的更多信息,请访问:www.microsoft.com/mvp。 非常感谢您在过去一年中为 Visual Developer - Visual C++ 技术社区所做的杰出贡献。