Thank you for your help phantom.
I've gained some more insight into this issue though still fail to solve it. The latest debugging make me believe that some GDI functions might make the device context no longer supported by the rendering context. The MSDN on wglMakeCurrent function says:
The hdc parameter must refer to a drawing surface supported by OpenGL. It need not be the same hdc that was passed to wglCreateContext when hglrc was created, but it must be on the same device and have the same pixel format. GDI transformation and clipping in hdc are not supported by the rendering context. The current rendering context uses the hdc device context until the rendering context is no longer current.
This may match the error message of wglMakeCurrent (error code 2004, which means "the requested transformation operation is not supported").
I also found this issue has nothing to do with the auxiliary windows. When no auxiliary windows are created, the current rendering context (RC) remains the same (the RC of main window) even if wglMakeCurrent fails. So the rendering is sill OK. When auxiliary windows are created and shown, the current RC is changed to one of the RCs of auxiliary windows. So I end up with a black main window.