Posts in Microsoft
Farewell, dsoframer
- 11 March 2018
I know, it is long overdue. Microsoft discontinued it a decade ago. And Office is not meant to be embedded. I even advised people to not use it in new development almost a decade ago. Then why I keep using it for so long?
What part of Windows is written in .Net/WPF/Silverlight?
- 16 May 2016
user 曹一聪 on zhihu is curious how widely .Net is used within Windows components. Obviously an operating system component cannot depend on something that isn’t in the operating system, so nothing uses Silverlight in the desktop version of Windows. And because XP editions mostly did not ship with any .Net framework version, practically nothing from the XP days can use .Net. Only components newer than XP or rewrote after XP can use .Net, except those Windows Media Center and Tablet PC components that have .Net dependencies.
What’s new in Visual Studio Tools for Windows 10 Preview
- 24 March 2015
Looks like Windows 10 SDK gets renamed.
Book review: Mastering Windows 8 C++ App Development
- 08 August 2013
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.
Another breaking change related to 64 bit compatibility, this time in TAPISRV w/Windows 8
- 30 July 2013
The ADO team had to make a breaking change the ADO APIs due to compatibility problem with Microsoft Office. Now it seems to be Tapi’s turn.
When you get a System.BadImageFormatException. maybe you indeed have a bad system image.
- 08 February 2013
I am getting a StackOverflowException with two functions repeating on the call stack, one is the constructor of System.BadImageFormatException, another is System.Environment.GetResourceStringLocal.
How to: Migrating a CLR console Visual C++ project to Windows Forms
- 17 December 2012
Note: Windows Forms programming in new development is discouraged by Microsoft at this point as Microsoft wants to make full use of hardware accelerated drawing instead of using the CPU-intensive GDI. But maintaining old Windows Forms code in Visual C++ 2012 is still supported, GDI isn’t going anywhere anytime soon. Visual C++ 2012 removed the Windows Forms project template and I see people scramble to find ways to create a Windows Forms project. There is a walkaround that’s been around for years, that is, to convert a CLR console application to a Windows one, then add forms related code to the project. The basic steps are listed at http://support.microsoft.com/kb/317433, conveniently named “How to suppress the console window for a managed extensions to Visual C++ Windows Forms application”. Yes, the need to convert a C++ console application to windows forms is that old, back all the way back in the managed extensions for C++ days. So what I need to do to add Windows Forms support to a C++/CLI console application? Of course the System.Windows.Forms.dll reference is missing in a new console application, so I need to reference it:
Add the correct interface first in Adding an MFC Class from an ActiveX Control wizard.
- 04 December 2012
In good old times aka VC6, if you want to use an ActiveX in MFC, the Components and Controls Gallery would generate all the properties and methods of an ActiveX and pull dependent types and create wrapper classes for them as well. And it was good. It magically knows the main class of the Windows Media Player ActiveX is CWMPPlayer4 and that GetCurrentMedia method returns CWMPMedia.
Howto: reset IE security zone settings programmatically
- 26 November 2012
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:
What’s new in Windows 8 Developer Preview SDK headers
- 17 September 2011
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.
Bug in Security Update for Visual C++ Redistributable Package: April 12, 2011 causes program error on Windows 2000
- 17 April 2011
Update:Microsoft’s Visual C++ team has released workarounds on the problem. AVG has released an utility that can revert the KB2467175 update, downloadable at http://twitter.blog.avg.com/2011/04/avg-feedback-update-26411.html
How to solve LNK2001 errors related to Windows SDK CLSIDs
- 08 April 2011
User IMFCoder wants to know how to solve a LNK2001 error related to CLSID_CMpeg4sDecMediaObject. The user has no problem linking a lib file in the project but couldn’t find which lib the CLSID is in.
More ADO issues with KB983246/Windows 7 SP1: a reference count leaking when event is used
- 14 March 2011
Update: Microsoft fixed the issue in Windows 8.
What is the difference between int and System::Int32
- 22 November 2010
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
How to force popup window to navigate in the same window in a webbrowser control
- 22 November 2009
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.
Intercept the download dialog in webbrowser control
- 04 November 2009
User rsd102 looks already find the solution to his question when he posted the question to CSDN, except for one missing piece. The sample he found is for overriding the global download manager, and what he need is a process wide override.
Make the webbrowser control styled the same way as the hosting application
- 27 October 2009
User wtx_sonery wants to know whether it is possible to style the webbrowser control with the rest of the application.
How to change the user agent and download control flags in a webbrowser control host
- 09 October 2009
User vnetvvv wants to know how to change the user agent string in a VB6 webbrowser control.
How to disable navigation sound in webbrowser control
- 06 July 2009
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.
the Windows Server 2008 SP2 and Windows Vista SP2 Beta program has concluded.
- 19 May 2009
Nice run uninstalling pre-release SP and installing the RTM version…
Talking about Windows XP APIs
- 03 May 2009
Photobucket has deactivated the accounts of all free users and I have no idea what was in there now.
Walkaround for Error : An add-on for this website failed to run. When opening Visual C++’s Add Variable Wizard after IE 8 is installed
- 24 March 2009
Update: it looks like a lot of people are hitting this page by mistake. If you don’t write software for a living then this page is probably not for you.
415 Unsupported Media Type when WSE is NOT configured
- 14 February 2009
I have a web service that runs fine on my Windows XP. However, when I deploy to the production server, the web service returns 415 Unsupported Media Type when calling.
Links
- 03 February 2009
New warning message in MFC9:Warning: Creating dialog from within a COleControlModule application is not a supported scenario. Comments: when people takes the time to add a warning, there must be a reason.
Visual C++ 10 和 MFC 10的新特性
- 11 October 2008
Boris Jabes 和Damien Watkins将会在PDC上演示Visual C++10中的新功能。IDE的新功能包括基于SQL Compact的智能提示、 支持自定义插件的新的项目和编译系统、面向大型应用的优化和改善的调试体验。MFC库增加了对Windows 7 中新增的多点触摸检测功能和高DPI支持,以及Windows Vista中集成的功能,例如高彩图标 、 Windows 搜索和重启管理器。Visual C++程序员们才习惯不用MFC来直接调API。
Type ‘System.Web.UI.WebControls.Parameter’ does not have a public property named ‘DbType’
- 06 October 2008
In Visual C# 2005 SP1, I added an object data source to a web page that uses my business class as the select method. The method has one parameter of type Guid. The data source wizard generates code like this
When Microsoft Office Live Meets Google Chrome
- 08 September 2008
To use Microsoft Office Live, your computer must meet one of the following requirements:
Feedback from Microsoft
- 05 June 2008
Looks like the Microsoft Award for Customer Excellence
award
I got a few years ago…
MFC Feature Pack发布
- 07 April 2008
Visual C++项目组今天发布了Visual C++ 2008 Feature Pack。这个Feature Pack包含了一些以前需要付费给BCG Soft才可以使用的控件,例如BCG著名的窗口布局和风格自定义功能,不过也有一些有用的控件,例如文件夹列表、文件夹树、属性窗格等等。
Detect if a MSI component is installed
- 24 March 2008
A C# program for those who don’t know MSI SDK or C++. C++ programmers can find the API inside the msi.h file in Windows SDK.
MFC更新Beta版
- 08 January 2008
一个面向Visual C++ 2008的MFC更新测试版已经发布,同时也提供了文档的下载。这个版本包含新的界面的特性,例如Office Ribbon、2003和XP风格,Visual Studio风格和MDI标签。另外,这个版本也包含部分TR1的实现,例如正则表达式、更加丰富的集合和智能指针。 另外,在下载页面居然说这个版本还不支持Visual Studio 2008 Service Pack 1的Beta版,正式版才出来几天SP1的测试版就出来了?
STL/CLR, Compiler and Marshaling
- 12 April 2007
MSDN第9频道又采访了Visual C++类库组的项目经理Nikola Dudar和Sarita Bafna,以及质量控制组的Marina Polishchuk。尽管Visual C++项目组已经转移了工作重点,但是很少人注意到这一点。或许这些采访可以帮助你了解Visual C++项目组的工作。 为什么C++仍旧重要?
Visual Studio 2005 Untrusted by IE7
- 11 November 2006
Today I upgraded one of my development machine to IE7. Everything looks fine, except I have to change the FileDownload event handler to make my code compile.
Error: Unable to cast COM object of type ‘mshtml.HTMLDocumentClass’ to interface type ‘ICustomDoc’
- 23 October 2006
This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{3050F3F0-98B5-11CF-BB82-00AA00BDCE0B}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
‘The Microsoft Code’ by Adam Barr
- 23 June 2006
Unexpected possible title overline or transition. Treating it as ordinary text because it’s so short.
PRB: ::SetUIHandler Causes Changes in Save As Dialog
- 21 April 2006
For the description of this problem, see http://support.microsoft.com/kb/330441.
Microsoft MVP re-awarded again
- 04 January 2006
亲爱的 Sheng Jiang, 热烈祝贺并欢迎您参与 Microsoft® MVP Program! 作为本年度“最有价值专家”(Most Valuable Professional) 奖的获奖者,您成为了我们精英群体中的一员,在全球网上和网下技术社区中与他人积极分享 Microsoft 的产品和技术。Microsoft 向所有用技术帮助他人发挥潜力,从而促进社区发展的 MVP 们表示崇高的敬意。要了解有关 MVP Program 的更多信息,请访问:www.microsoft.com/mvp。 非常感激您在过去的一年中在指导Visual Developer - Visual C++技术社区中的同伴方面所做的杰出贡献。
Nomination of Microsoft Award for Customer Excellence
- 22 November 2005
Dear Sheng Jiang, Thank you for being a great contributor to Microsoft Visual Studio 2005. You have been nominated to receive the Award for Customer Excellence. This award recognizes your extraordinary contribution to the Visual Studio 2005 product and will be shipped to you without charge. Please click the following link to arrange shipment of your award: (link omitted) Should you have any questions about this award, please contact (email omitted). All the best, S. Somasegar Corporate Vice President, Microsoft Developer Division
Find and replace specific formatting in Word 2003
- 10 November 2005
In Microsoft Word 2003, you can replace text as in other programs. However, you can replace line breaks, graphics, and special formats as well. For example, to seperact and to add a serial number before every sentence, you can replace sentence-ending punctuations, such as periods and question marks, to the same punctuations plus a line break, click the numbering toolbar button, and make some minor manual changes for misreplacement.
How to use Visual C++ with Perl
- 03 November 2005
Microsoft Visual C++ and later do not support perl scripts by default. That is, the Developer Studio does not associate any special significance to perl scripts without being informed otherwise. However, there are several viable options, namely custom build rules, which enable the creation of projects that depend directly upon perl scripts. The remainder of this article discusses the following three methods for adding perl script files to a Visual C++ project:
Access your documents from internet.
- 22 September 2005
一个飓风刚走,另一个更大的飓风又来了,这回是直冲本州而来。新奥尔良和休斯敦疏散过来一大堆人,但是这里很可能也得疏散。希望休斯敦不会成为第二个新奥尔良。
《转换指南: 将程序从托管扩展C++迁移到C++/CLI》译后
- 17 March 2005
终于把Stan Lippman先生的这篇文章译完了。从去年4月在全球MVP峰会上拿到这篇文章的手稿到现在,差不多一年过去了。虽然当时的Visual Studio 2005还不支持一些语法,但是我和董颖涛对新的C++/CLI语言都很感兴趣,在当时就讨论过翻译的问题。之后我就开始翻译这篇文章,但是进度一直很慢——主要是杂务太多、语言上的困难(尽量避免误解和词不达意的情况,以及斟酌用词的选择)。在1月份完成了全文之后,看到了Sunhui的一篇文章(http://community.csdn.net/expert/Topicview1.asp?id=3834281),觉得附录里面讲到的一些内容或许一些人也有兴趣,所以继续翻译附录的工作,幸好现在是春假,比较有时间,终于在今天完成了。译文目前在http://blog.csdn.net/jiangsheng/archive/2004/10/18/140450.aspx可以访问,希望读者指正。