11/10/2009

Class Wizard is back to Visual C++ in Visual Studio 2010... Control Shift X.

image

After 4 versions. Finally.

More features: Now you have partial search in options

The Wizard does not always find every handler function.  I got warning when trying to create a handler if there is one already. Delete handler does not work when an existing handler is not detected.

Sometimes I have “value does not fall in expected range” when trying to bring the class wizard if I have source files open.

8/27/2009

关于最近Visual Studio的ATL更新

如果使用Visual C++ 2005或者2008,那么这个更新可能已经被自动安装了。这个更新修补了ATl库中的一些安全问题。在安装这个更新之后,Visual C++运行时刻库会升级。这意味着如果代码面向的CRT版本是_CRT_ASSEMBLY_VERSION或者_BIND_TO_CURRENT_VCLIBS_VERSION,那么要随着新编译的程序发布新版本的CRT。如果程序没有定义这些宏,那么安全更新安装的重定向策略会把绑定到旧版本的引用自动转向新的CRT版本。

一个常见的问题是链接到旧版本的编译器生成的库文件。这样会在编译器生成的应用程序清单中生成两个不同版本的CRT引用。这时候要用合并模块或者手动编辑策略文件,确保重定向策略被正确安装到系统。

由于用户未必安装了Windows Update补丁,程序员需要随程序发布最新的Visual C++文件。对于vcredist发布的程序,可以直接下载Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update。这个再发布包也可以在安装了Visual Studio的计算机中找到。对于使用安装程序制作工具的场合,Visual Studio会更新安装和部署项目使用的合并模块(Program Files\Common Files\Merge Modules)和bootstrapper(Program Files\Microsoft SDKs\Windows\版本号\Bootstrapper\Packages或者Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages),第三方安装程序制作软件则可能需要安装补丁或者手动替换Visual C++文件。如果应用程序把VC文件发布到安装文件夹,那么安装文件夹内的文件也需要更新以使用最新的运行时刻库和版本重定向策略。

一些旧版本的Windows SDK也包含ATL,建议使用新版本的ATL以避免安全问题。如果在安装了Visual Studio 2008 SP1之后安装了Windows SDK 6.1,那么在编译ATL项目时会出现编译错误

error C2039: '_Swap_adl' : is not a member of 'std' c:\program files\microsoft visual studio 9.0\vc\include\xutility 2764
error C3861: '_Swap_adl': identifier not found c:\program files\microsoft visual studio 9.0\vc\include\xutility 2764

这是由于Windows SDK 6.1包含Visual Studio 2008版本的ATL。解决办法是卸载SDK和VisualStudio,先装SDK,后装Visual Studio、SP1和ATL更新。

这个更新包含的不只是ATL的头文件,可以在KB971092里面看到大堆的PDB和再发布文件也被更新了。不建议手动更改ATL头文件来绕过安全问题,这样的话微软的更新程序不能更新修改过的文件。如果你已经手动更改了ATL的头文件,可以重新运行VisualStudio安装程序,卸载VisualC++之后重新安装,再应用SP1和ATL更新。下次修改系统头文件的时候,可以把文件复制到自己的目录,修改之后更改Visual C++的目录搜索路径。

关于这个更新的更多信息,可以参考MSDN第9频道的视频

5/31/2009

Bug in Media Player causes shutdown of Internet in China.

China’s Internet Service Providers (ISPs) do not like to talk to each other. the vast majority (90% in 2006) of customer complains received by the Ministry of Information Industry is about super slow interconnectivity of the two major ISPs, China Telecom and China Netcom, and people’s workarounds of the interconnectivity problem have side effects, like the recent Internet outrage caused by the Baofeng Media Player.

Here is a little background. The interconnectivity problem arose after the spin-off of China Netcom from China Telecom 2002. Before the split, China Telecom had a monopoly on network bandwidth, and local ISPs could not really compete with China Telecom because they had to rent China Telecom’s bandwidth for non-local services. The government ordered a split of the company after most of local ISPs went out of business, and created the interconnectivity problem.

After the spin-off, the China Telecom network is now split into two subnets, China Telecom in south and China Netcom in north. The two companies employed some anticompetitive tactics, including exclusive service agreements with estate developers and not keeping up with growing demand of interconnectivity between major networks. In 2006, the only bridge between them was a connection point at Beijing, which was often so overwhelmed that it was usually slower than routing though a USA network or switching to China Mobile’s CDMA wireless network.

In fact, the majority of connectivity was done by businesses. With ISPs reluctant to connect each other themselves, the only solution was to connect both networks and double the connectivity expense. At the beginning, the users were directed to ISP-specific addresses like http://chinatelecom.example.com in the China Telecom network, and http://chinanetcom.example.com in the China Netcom network. The problem was, users often didn’t know what their ISP is when they are not visiting Internet at home. Soon ISP-specific domain name service (DNS) server were created to direct visitor to the the address inside the visitor’s network. Now the user can use http://www.example .com and the DNS will decide which address the user will be visiting based on the user’s network. The free, personal financed DNSPod is this kind of DNS service.

Unfortunately, several DNS servers of DNSPod were hit by a distributed denial-of-service (DDOS) attack on the night of May 18. DNSPod’s owner did not think the attack was serious, because he dealt with larger attacks before. However, the DNS server China Telecom shut-off this time was hosting a web site used by the Baofeng Media Player, which manifested the DNS outrage to a much greater magnitude.

There was no explanation why the Baofeng Media Player’s company, a multi-million dollar investment with a self-claimed user base of 200 million , is using a free (*read* no warranty of any kind, agreed not liable to damage before using) DNS service. However, the greater mistake was that the Baofeng Media Player’s advertisement downloading service was programmed to go through each server on its server list until it gets an answer. When the ISP’s local DNS cache pointing to the downed DNSPod server expired, the requests to find servers put almost all DNS servers in China under a DDOS attack . At the attack’s peak, Baofeng Media Player’s DNS requests occupied 40% of China Telecom’s total bandwidth. A DDOS attack targeting a specific domain now transformed into a DDOS attach on almost all DNS servers in China, which slowed down the Internet in China to a crawl.

After a day of network outrage, there are lessons to be learned , from programming errors to doubtful business tactics. One thing is for sure, Baofeng Media Player’s advertisement downloading service is the one to blame for this disaster. However, Baofeng Media Player is not the first software with bugs, nor will it be the last one. China ISPs need to think about how to avoid this problem in the future, the sooner the better.

5/29/2009

Not sure what is going on at Microsoft Connect

An item I submitted to Microsoft connect changed 3 times at 1:34 am this morning

The following feedback item you submitted at Microsoft Connect has been updated:
The following fields or values changed:
Field Status changed from [Active] to [Resolved]
Field Resolution changed from [Not Set] to [Fixed]

The following feedback item you submitted at Microsoft Connect has been updated:

he following fields or values changed:
Field Status changed from [Active] to [Resolved]

The following feedback item you submitted at Microsoft Connect has been updated:

The following fields or values changed:
Field Status changed from [Resolved] to [Active]

Another item changed 5 times yesterday

The following feedback item you submitted at Microsoft Connect has been updated:

Field Status changed from [Active] to [Resolved]
Field Resolution changed from [Not Set] to [Not Reproducible]

The following feedback item you submitted at Microsoft Connect has been updated

The following fields or values changed:
Field Status changed from [Resolved] to [Closed]

The following feedback item you submitted at Microsoft Connect has been updated:

Field Status changed from [Closed] to [Active]

 

The following feedback item you submitted at Microsoft Connect has been updated:

Field Status changed from [Resolved] to [Closed]

The following feedback item you submitted at Microsoft Connect has been updated:

Field Status changed from [Active] to [Resolved]
Field Resolution changed from [Not Reproducible] to [Fixed]

Conclusion: the operator update connect feedbacks in the same way I wrote Wikipedia articles. Stay up after midnight and have a lot of revisions, some good.