Posts in Visual C++

Book review: Mastering Windows 8 C++ App Development

Disclaimer: I am a Microsoft MVP in Visual C++, so is Pavel Yosifovich, the author of the book. Mastering Windows 8 C++ App Development by Pavel Yosifovich is a new addition to the Windows Store development books. It took me a while to read (304 pages) but is well worth the time from the perspective of a C++ developer. The book obviously went through great lengths to be comprehensive, not only introduced the typical Windows Runtime (WinRT) APIs in a crisp manner but also added a refreshment of C++ 11, the Model View ViewModel (MVVM) pattern, and the Windows Runtime C++ Template Library (WRL). In addition, being a book for C++ developers, the author’s emphasis on performance can be found in several tips and discussions, which is a nice focus for C++ developers. There are also several weaknesses in the book. Introducing WRL before C++/CX may be a poor choice as it is difficult to inspire the reader with laborious code. Also the book could use a few more details on DirectX and some WinRT APIs such as GeoPosition. Nevertheless, the book is an excellent text for the subject and I recommend the book to C++ programmers who want to start developing Windows Store apps and can do research outside of the book.

Read more ...


How to restart Windows Explorer programmatically using Restart manager

You can download source code of this post at jiangsheng/Samples

Read more ...


Howto: reset IE security zone settings programmatically

Internet Explorer 7 introduced the IInternetZoneManagerEx2 interface, which has a FixUnsecureSettings method to reset all security zone settings. Like all other IInternetZoneManager* interfaces, you can query this interface from the internet zone manager object:

Read more ...


What’s new in Windows 8 Developer Preview SDK headers

This is by no means a complete list but just some observation on files that caught my eye. Some are just regular header file updates for Windows 7 and does not necessary require Windows 8. Some other APIs moved to header files with more readable names.

Read more ...


Windows Update KB2538242 or KB2538243 offered repeatedly

Recently (this post was originally published in 2011) there is an outburst of posts related to the KB2538242 update being offered repeatedly on MSDN’s Visual C++ forums, TechNet’s various Windows security forums and the Windows Update forum on Microsoft Answers forums. Questions about KB2538243 appear as well, but to a less degree.

Read more ...


What is the difference between int and System::Int32

Some may say identical, at least that’s what the Visual C++ compiler tells you at the first glance  when you turn on /oldsyntax public __gc class Class1 { public: void F1(int a){} void F1(System::Int32 a){} //Error    2    error  2535:  void Class1::F1(int)’ : member function already defined or declared } Okay, so if I add & to the parameter types I should get the same error right?void F1(int&a){} void F1(System::Int32& a){} Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped Wait, didn’t I get an error just now? You are right, somehow the compiler treat the two types differently when passing by reference. look at the function signatures in MSIL. Int32 is passed by reference as expected

Read more ...


Application crash when forcing IE8 rendering mode in webbrowser host

[caption id=”” align=”alignright” width=”256” caption=”Image via Wikipedia”]Internet Explorer Mobile Logo[/caption]

Read more ...


How to force popup window to navigate in the same window in a webbrowser control

When clicking on an link that targets a new window,  the default behavior of a webbrowser control host application is to open a new window in Internet Explorer. User ben_lai wants to know how to handle the click and navigate to the same window.

Read more ...


Getting local FTP home directory from IIS programmatically

User xiaoc1026 wants to know how to access IIS to get the home directory of the FTP web site in Visual C++.

Read more ...


How to change the user agent and download control flags in a webbrowser control host

User vnetvvv wants to know how to change the user agent string in a VB6 webbrowser control.

Read more ...


How to disable navigation sound in webbrowser control

User kill211 does not like the click sound when he calls WebBrowser.Navigate. He wonders if there is a way to disable it without modifying HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\Navigating, which has effect on other applications.

Read more ...


MFC更新Beta版

一个面向Visual C++ 2008的MFC更新测试版已经发布,同时也提供了文档的下载。这个版本包含新的界面的特性,例如Office Ribbon、2003和XP风格,Visual Studio风格和MDI标签。另外,这个版本也包含部分TR1的实现,例如正则表达式、更加丰富的集合和智能指针。 另外,在下载页面居然说这个版本还不支持Visual Studio 2008 Service Pack 1的Beta版,正式版才出来几天SP1的测试版就出来了?

Read more ...


PRB: ::SetUIHandler Causes Changes in Save As Dialog

For the description of this problem, see http://support.microsoft.com/kb/330441.

Read more ...


Microsoft MVP re-awarded again

亲爱的 Sheng Jiang, 热烈祝贺并欢迎您参与 Microsoft® MVP Program! 作为本年度“最有价值专家”(Most Valuable Professional) 奖的获奖者,您成为了我们精英群体中的一员,在全球网上和网下技术社区中与他人积极分享 Microsoft 的产品和技术。Microsoft 向所有用技术帮助他人发挥潜力,从而促进社区发展的 MVP 们表示崇高的敬意。要了解有关 MVP Program 的更多信息,请访问:www.microsoft.com/mvp。 非常感激您在过去的一年中在指导Visual Developer - Visual C++技术社区中的同伴方面所做的杰出贡献。

Read more ...