Author Archives: Sheng Jiang 蒋晟

About Sheng Jiang 蒋晟

Microsoft MVP in Visual C , 2004- Forum moderator of the Visual C and .Net forums on CSDN Forum moderator of Chinese forums on Microsoft's MSDN forums

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 … Continue reading

Rate this:

Posted in enmsdn, Microsoft, Visual C++, Visual Studio | Tagged , , , , , , | Leave a comment

Another breaking change related to 64 bit compatibility, this time in TAPISRV w/Windows 8

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. In the 64 bit editions of Windows 8 and Windows Server 2012, some TAPI … Continue reading

Rate this:

Posted in enmsdn, Microsoft | 1 Comment

Howto: Ignoring web browser certificate errors in a webbrowser host

The webbrowser queries host services via IServiceProvider implemented on the ActiveX host. One of the services is IHttpSecurity, which can be used to override the certificate problem dialog. Security warning: ignoring security problems can compromise your application. IHttpSecurity is derived from IWindowForBindingUI, … Continue reading

Rate this:

Posted in C#, MFC, Microsoft, Visual Studio, Webbrowser control | Tagged , , , , , | 2 Comments

When you get a System.BadImageFormatException. maybe you indeed have a bad system image.

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.  Since the call that throws the stack overflow is to a web service proxy defined in the same project as the application, … Continue reading

Rate this:

Posted in Microsoft, Visual Studio | Tagged , , | 1 Comment

How to restart Windows Explorer programmatically using Restart manager

For shell extension programmers, restart Windows Explorer is one of steps in their setup programs. A programmer may also want to force some shell setting changes that would only be read by Explorer on start up. For example, this posts … Continue reading

Rate this:

Posted in enmsdn, Microsoft, Visual C++, Visual Studio | Tagged , , , | 3 Comments

How to: Migrating a CLR console Visual C++ project to Windows Forms

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 … Continue reading

Rate this:

Posted in C++/CLI, enmsdn, Microsoft, Visual C++, Visual Studio | Tagged , , , | Leave a comment

Add the correct interface first in Adding an MFC Class from an ActiveX Control wizard.

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 … Continue reading

Rate this:

Posted in enmsdn, MFC, Microsoft, Microsoft Foundation Class Library, Visual C++, Visual Studio | Tagged , , , | Leave a comment

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: IInternetZoneManagerEx2* pzoneManager=NULL; HRESULT hr=CoCreateInstance(CLSID_InternetZoneManager ,NULL,CLSCTX_INPROC_SERVER,IID_IInternetZoneManagerEx2,(LPVOID*)&pzoneManager); if(hr==S_OK && pzoneManager!=NULL) { … Continue reading

Rate this:

Posted in enmsdn, Microsoft, Visual C++, Visual Studio, Webbrowser control | Tagged , , | Leave a comment

What’s new in MFC/ATL 11 Beta

Note this post is on Visual Studio 11 Beta, you can download it from http://www.microsoft.com/visualstudio/11/en-us/downloads Since Sinofsky posted about no desktop apps on Windows on ARM (WOA), it looks like MFC and ATL are going to support metro-style apps, although … Continue reading

Rate this:

Posted in Visual C++ | Tagged , , , | Leave a comment

Choosing formats when putting data on clipboard

The topic is from a forum discussion at http://social.msdn.microsoft.com/Forums/en/windowssdk/thread/94bb2db4-3ca2-4cd8-9f7c-6dd9aab6fd18 Generally an application should provide data in as many formats as possible so more applications can recognize the data. For example, IE stores text data in CF_UNICODETEXT, CF_TEXT and CF_HTML formats. Because … Continue reading

Rate this:

Posted in enmsdn, Webbrowser control | Tagged | Leave a comment