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.

Improvements are focused, of course, in natural input, efficiency, gaming experience and IE. You can hear the silence scream of “Tablet!Tablet!Tablet!” here. Note Windows 8 is still a developer preview and there is no guarantee any new feature will survive the final cut or there won’t be new API for existing features add in Beta/RC/Gold.


There is no improvement in the GDI-based shell common controls. No surprise here. The new UI would be based on WinRT and will use GPU to render instead of CPU. There are COM API for printing, which is traditionally performed via GDI.

A lot of Direct2D and Direct3D improvements. XAudio2 added and battery/pad support  added to XInput. Improvement in 3D rendering, device removal during capturing and stream seeking in Windows Media Foundation. API for H264 codec.


Header guard for IE5.01 or lower are removed. Building for Windows 2000 is now practically impossible. Some header guard switched to NTDDI_VERSION. There is A new camera UI control based on COM. Somehow the version guard of Shell_NotifyIconGetRect is lost, this might be a header file bug.


Lots of IE 10 APIs and HTML 5 support. ActiveScript optimized for multiple instance and webworker. Also there is a new IActiveScriptContext interface to get url, line and offset of the script. New timeout configuration in WinInet. ActiveX filtering, and options to enable/disable audio/video plugins added for IE security zones.


Accessibility for windowless controls and lots of UI automation improvements, including grid and spreadsheet types. Candidate list integration and async document support with Text Service Framework. ARM support to .Net APIs.  A lot of pointer device and touch messages, notification and drawing.

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

Where is the forum for Internet Explorer?

People get confused by various Microsoft IE forum sites so here is the steps to find the forum closer to IE related questions

Basically, the mentality of different Microsoft forum brand is:

MSDN: How can my software do something on my customers’ machines.

Technet: How can I manage things on machines in my network.

Answers: How can I do something on my own machine.

So for the case involving IE:

  1. using IE
  2. manage IE on someone else’s machine, or IE behaves abnormally only when the IE settings is managed by the network administrator
  3. Writing IE-aware software or IE-aware web sites http://social.msdn.microsoft.com/forums/en-US/category/iedevelopment/

What about other tasks?

  1. I have problem with an IE add-on
    contact the support channel of the add-on. For example if there is a problem when viewing PDF in IE, most likely you need to visit the Adobe Reader forum at forums.Adobe.com. A question that occurs only after installing Google ToolBar should be posted to Google’s help groups.
  2. I see an error message in IE when visiting a web site
    does the error message appear when you switch to another web browser?

    1. Yes
      Contact the author of the web site

      1. But I am the author of the web site!
        Then try ask in a forum that covers the server programming framework, for example, visit forums.asp.net if you have ASP.Net errors.
    2. No
      Run IE in no-addon mode(shortcut can be found in programs->accessories), is the problem still there?

      1. Yes
        Do you see this error when visiting other web sites?

        1. Yes
          visit http://answers.microsoft.com/en-us/ie/forum
        2. No
          Contact the author of the web site

          1. But I am the author of the web site!
            Then visit http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/threads and remember to include your web site’s link when asking
      2. No, where do I find the faulty add-on?
        Tools->Manage addons, and disable one-by-one, I guess. Those experts in http://answers.microsoft.com/en-us/ie/forum probably have more experience in known faulty add-ons.
  3. IE tells me there is a script error on the web site
    Does this problem occur regardless which web sites IE is showing?

    1. Yes
      Visit http://answers.microsoft.com/en-us/ie/forum. Oh, and if you are going to do a repair install of IE before asking, remember to turn antivirus off.
    2. No, the script error only occur on certain web sites
      Are you the author of the web site involved?
      1. No
        Contact the authors of the web sites.

        1. The author cannot be found or I can’t wait the author to release an update
          Add the web site to the compatibility view list to see if the site works in old browser emulation mode.
      2. Yes, I am the author
        If you can reproduce your problem in no-addon mode, visit http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/threads 
Posted in Uncategorized | Tagged , | Leave a comment

Windows Update KB2538242 or KB2538243 offered repeatedly

Microsoft Update in Windows XP.

Image via Wikipedia

Recently 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.

To save your time going to the forums or calling Microsoft’s free security hotline, this is my answer:

KB2538242 (maybe KB2538243 as well, but I did not find an official response from Microsoft) is defective and will be replaced. In the mean time, you can hide it and unhide after the fix is released (probably in a week or so), or manually download the updates from Microsoft’s download center.


This update is offered when Microsoft Visual C++ Redistributable is installed along with one of the apps created using a Microsoft software developer tool called Visual C++. To make those app more secure, Microsoft offers security update for the customers of its customers of developer tools. You may not have those components installed, if you did not install one of these apps that ship with Visual C++ components. On a 64bit computer, the system could have both x86 and x64 editions of Visual C++ Redistributable installed, since Visual C++ is a common used component, and it is normal to have 32bit apps and 64bit apps installed on a 64bit system


From reading the reports on Microsoft Answer’s Windows Update forum, Windows Update correctly detects the x64 edition of Visual C++ Redistributable needs to be updated, but downloads the x86 edition to install. Some Windows x64 edition users reports the problem goes away by manually download the x64 edition to install, probably inspired by an old walkaround for KB2467175.

Based on the number of error reports and those “me too” comments, Visual C++ 2005 programs probably have a customer base 9 times larger than Visual C++ 2008. Looks like either those Visual C++ programmers are slow to update their tools, or the customers of those programmers are slow to update their apps.

A Microsoft tech support is quoted as saying “Visual C++ packages were written by a ‘third party’. ” Who wrote these update packages? Microsoft’s Visual C++ team should not be called like this. To Windows users, Microsoft is a single entity.

See also

How to troubleshoot Windows Update or Microsoft Update when you are repeatedly offered an update

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

Bug in Security Update for Visual C++ Redistributable Package: April 12, 2011 causes program error on Windows 2000

Windows Update version 3 in Windows 98

Image via Wikipedia

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

Avira is reporting that its AntiVir software throws “The procedure entry point FindActCtxSectionStringW could not be located in the dynamic link library KERNEL32.dll.” error after installing the update released earlier this week.

This is caused by the introduction of FindActCtxSectionStringW in the MFC update which is distributed to affected computers where the Visual C++ Redistributable is installed by affected programs. I guess Microsoft did not test the update on Windows 2000 since Windows 2000’s support has expired, and indeed removed Windows 2000 from the supported platform list of the redistributables on the Microsoft download center page, but nonetheless those who develop software using Visual  C++ 2005 and Visual  C++ 2008, two currently supported products, would still not able to support Windows 2000 users after this update (KB2467174  and KB2467175).

Microsoft already withdrawn the update to fix this issue. On April 21, 2001, Microsoft rereleased the update, and made only a detection change, means the update won’t be offered to Windows 2000 again.

Suggestion to end users and software developers who already installed the update on Windows 2000: Uninstall the April 12, 2011 updates, remove leftovers mentioned in the KB articles identified by the updates and install the ATL security update versions (search in download.microsoft.com to get those updates) for now.

Suggestion to software developers: Call SetSearchPathMode to turn on the safe dll searching mode at the beginning of the app, and join the discussion Always ask the developer before applying a security fix or service pack to Visual Studio that need changed the C++ runtime DLLs ATL/MFC/CRT.

Affected software:

Other known issues in this update can be found in a follow up post at the Visual C++ blog.
Alternative error message: 
Posted in enmsdn, MFC, Microsoft, Visual C++, Visual Studio | Tagged , , , , | 10 Comments

How to solve LNK2001 errors related to Windows SDK CLSIDs

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.

The Windows SDK is strangely cryptic on which lib file the CLSID is exported from. Luckily you can find out the library file you need to link with, if you execute the following command line in the SDK command prompt

Update: use findstr /m /S /c:”CMpeg4″ *.lib
is easier 

C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib>for %a in (*.lib) do dumpbin /symbols %a |find “CMpeg4”

After a bunch of fruitless searches, the search yields the results when it encounters wmcodecdspuuid.lib

C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib>dumpbin /symbols wmcodecdspuuid.lib   | find “CMpeg4”
056 00000000 SECT1D notype       External     | _CLSID_CMpeg4DecMediaObject
059 00000000 SECT1E notype       External     | _CLSID_CMpeg43DecMediaObject
05C 00000000 SECT1F notype       External     | _CLSID_CMpeg4sDecMediaObject
05F 00000000 SECT20 notype       External     | _CLSID_CMpeg4sDecMFT
065 00000000 SECT22 notype       External     | _CLSID_CMpeg4EncMediaObject
068 00000000 SECT23 notype       External     | _CLSID_CMpeg4sEncMediaObject

There is a big uuid.lib file contains most of the SDK CLSIDs in the Windows SDK, and it is likely linked by default if you use Visual C++’s project templates, so you may not see the link error at all if you use common CLSIDs like CLSID_InternetExplorer.

There are also GUIDs defined in the Windows SDK using the DEFINE_GUID macro. The SDK assumes you to initialize the GUID using the methods demonstrated in How to avoid error “LNK2001 unresolved external” by using DEFINE_GUID.

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

More ADO issues with KB983246/Windows 7 SP1: a reference count leaking when event is used

Windows Update

Image via Wikipedia

Update: Microsoft fixed the issue in Windows 8.

User Angus Robertson is reporting that in an application that references ADO 2.1 type library and getting records using the adAsyncExecute method, each execute call  leaks three handles and about 20K of memory. A fix is promised in a future version of windows but since MDAC is an in-band OS component, an widely-available update would be in a service pack just like how kb983246 was delivered. Concerned ADO users should contact Microsoft Customer Support service and request a hotfix, once that is available.

By the way, if you are still in XP or 2003, there is a deadlock issue when using the same adAsyncExecute option. This issue is fixed on Vista.

Posted in Microsoft | Tagged , | Leave a comment

Breaking change in ADO update KB983246 (included in Windows 7 Service Pack 1)

The Microsoft Logo

Image via Wikipedia

Update2: Microsoft fixed the issue in Windows 8 in a way that old programs would work without change. Those who recompiled with the KB983246 version either need to roll out KB983246 to customer computers or switch back to the old type libraries. New programs are encouraged to use the KB983246 version of type library when they no longer need to support computers without KB983246.

Update: please refer to the knowledge base article kb2517589 An ADO application that is re-compiled on a Windows 7 Service Pack 1-based computer does not run on down-level operating systems for walkarounds.

After installing Windows 7 SP1, which shipps with msado15.dll version:6.1.7601.17514, your ADO program may no longer work on a computer without KB983246 (msado15.dll 6.1.7600.20701).

This is caused by a problem in the old ADO type library regarding the ADO_LONG data type. Some methods’ parameters use a ADO_LONG data type whose meaning got changed to the 64bit LONGLONG on 64 bit machines. This does not adhere to the COM interface protocol as the interface used by old applications is still thinking the parameter type is LONG . I guess that’s why KB983246 suggests Office 2010 64 bit, since Office is one of the most common ADO programs on a 64 bit computer, and 64 bit Office would be more likely to be automated from 32bit COM client than other 64 bit programs.

In order to fix the compatibility issue with 64bit COM servers (including for those 32bit clients, since out-of-proc COM works across bitness), Microsoft introduced a breaking change in the ADO COM interface, changing the parameter type to ADO_LONGPTR. The complete list of changed APIs are listed at http://support.microsoft.com/kb/983246#mi. The result of the interface change causes renaming of the old interface with a postfix _deprecated and new interface IDs for the ADO interfaces. The breaking change means a “type mismatch” or 80004003 error in early binding ADO programs, when the ADO hotfix KB983246 is not installed in the user’s computer. If an IDE does early binding at compile time (e.g. VB6 programs who reference ADODB Data Controls using progids such as “Dim conn As ADODB.Connection: Set conn = New ADODB.Connection”), the compilation would fail with errors like “Class does not support Automation or does not support expected interface”.

The walkarounds suggested by Microsoft are to either upgrade customer computers with the KB983246 hotfix or switch to late binding. In addition there are programmers who remove Windows 7 SP1 or bind to an old version of the msado28.tlb file that get copied to the development machine somehow, getting around Windows’s system file protection by taking ownership of the files and grant access to administrators.

I wonder how many other LONG-based data types exist in Microsoft’s COM APIs and how Microsoft is going to fix all of them for 64bit products. Looks like there are in deed some 64bit COM issues, like The call operation fails with error code “0x800706f7” when you run an application that calls the OleCreateFromFile() function to create an embedded object from the contents of a named file in a 64-bit

DevExpress support folks had no clue when this issue was reported to them.

Known affected software:

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

Microsoft MVP again

Image by EJeffson via Flickr

The award email is almost identical to last year’s, so I assume Microsoft would go greener and more renewable with the Microsoft MVP award program each year, maybe that’s the reason I got a frosted glass lug instead of a trophy like previous years.


The dangling cards on the right are the ID badges for the last two years which are the only other award items that have my name besides the certificates. There are two lugs on the 2010 trophy for 2010 and 2011. The trophy on the left is for 2009. They look at lot cooler than my 2008 one, though you can tell it takes more effort to inscribe the 2008 trophy with my photo. 2008 is the only time the trophy come with a photo. Previously I only get trophies with my name on.


Here is the box, not much inside except the certificate. The award disk is stacked on the 2010 trophy already. The lapel pin is there every year but it is hard to keep because it’s too small and I practically never wear it. The certificate is going greener too, at least the frame is becoming lighter than previous years.


You can also see the MVP logo changed a while ago, and the whole certificate goes blue in 2009. The last time I got other stuff from Microsoft was back in 2008, when the gift package has an MVP branded Bluetooth package including USB adapter, wireless headphone and a laptop mouse that I can’t use because I don’t own a laptop. Perhaps that’s why Microsoft stopped wasting money on stuff people may not use. Now Microsoft is also asking MVPs to give back a little bit to the community this year at the Northwest Harvest Sponsored event via GeekGive. Perhaps we will be handing out food stamps at the site.

Looks like my 2008 MVP certificate is missing. The green certificate is for community star which I got back in 2003 when newsgroups were still active (ah, the good old days). The letter on the left bottom is the congratulation letter of Microsoft “Most Influential Developer” program (now called Microsoft CNTAC, I guess, though I never figured out why it was called Microsoft GDI back then). The middle yellow one is from the Microsoft Customer and Partner Experience program.

I will be at the MVP Summit in Seattle next month to help shape the next version of Visual C++. That’s mostly what the summits is about these days instead of the traditional award ceremony “you rock! let’s party!” kind of thing. I am glad that Microsoft find out how to make the most out of an award ceremony. Anyway, if you have concerns and questions about Visual C++’s future, now is the time to leave your comments.

Posted in Microsoft, Visual C++ | Tagged , , , | 4 Comments

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
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

.method public instance void F1(int32& modopt([mscorlib]System.Runtime.CompilerServices.IsImplicitlyDereferenced) a) cil managed
    .maxstack 0
    L_0000: ret

and int is passed by address (the behavior is different if you switch to new syntax)

.method public instance void F1(int32* modopt([mscorlib]System.Runtime.CompilerServices.IsImplicitlyDereferenced) a) cil managed
    .maxstack 0
    L_0000: ret

I guess it does not make a big deal right?

Until you have an interface assembly that is compiled in anower compiler and want to implement the interface. Now you have a hard time to figure out how to declare the signature in the new syntax.

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

Application crash when forcing IE8 rendering mode in webbrowser host

Internet Explorer Mobile Logo

Image via Wikipedia

User stephench is reporting that when setting webbrowser rendering mode to IE8 via FEATURE_BROWSER_EMULATION, the app would crash.  The web site crashes IE8 too, but IE8 is able to recover and automatically switch to IE7 mode, while a webbrowser host crash in WinInet when switching to the compatibility mode (Note the ReloadInCompatView function on the call stack). My guess is that reloading requires a WinInet helper process which a webbrowser host app does not have.

The call stack is the following

urlmon.dll!UUIDToWSTR()  + 0x1f bytes
urlmon.dll!GUIDToWSTR()  + 0x1a bytes
urlmon.dll!GUIDToWSTRCch()  + 0x16 bytes
urlmon.dll!CInPrivateBrowserModeFilter::_EnsureCLSID()  + 0x20 bytes
urlmon.dll!CSessionBrowserModeFilter::_GetDataStream()  + 0x27 bytes
urlmon.dll!CBrowserModeFilter::_EnsureBrowserModeFilter()  + 0x1d84 bytes
urlmon.dll!CBrowserModeFilter::IsIE7Mode()  + 0x2e bytes
mshtml.dll!CMarkup::ReloadInCompatView()  + 0xd0 bytes
mshtml.dll!CCssPageLayout::CalcSizeVirtual()  + 0x120416 bytes
mshtml.dll!CLayout::CalcSize()  + 0x164 bytes
mshtml.dll!CLayout::DoLayout()  + 0x113 bytes
mshtml.dll!CView::ExecuteLayoutTasks()  – 0x1e376 bytes
mshtml.dll!CView::EnsureView()  + 0x567 bytes
mshtml.dll!CView::EnsureViewCallback()  + 0x66 bytes
mshtml.dll!GlobalWndOnMethodCall()  + 0xcc bytes
mshtml.dll!GlobalWndProc()  + 0xae bytes
user32.dll!_InternalCallWinProc@20()  + 0x28 bytes
user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7 bytes
user32.dll!_CallWindowProcAorW@24()  + 0x51 bytes
user32.dll!_CallWindowProcA@20()  + 0x1b bytes
mfc100.dll!_AfxActivationWndProc(HWND__ * hWnd=0x00150a28, unsigned int nMsg=32770, unsigned int wParam=0, long lParam=0)  Line 471 + 0x11 bytes    C++
user32.dll!_InternalCallWinProc@20()  + 0x28 bytes
user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7 bytes
user32.dll!_DispatchMessageWorker@8()  + 0xdc bytes
user32.dll!_DispatchMessageA@4()  + 0xf bytes
>    mfc100.dll!AfxInternalPumpMessage()  Line 183    C++
mfc100.dll!CWinThread::Run()  Line 629 + 0x7 bytes    C++
mfc100.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00152348, int nCmdShow=1)  Line 47 + 0x7 bytes    C++

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