error MIDL2311 : statements outside library block are illegal in mktyplib compatability mode

解决办法:

1. Do not use the /mktyplib203 switch unless you have to deal with legacy code dating back to mktyplib ver.2.03.

2.  In the .odl file, put the following inside the library block:

     #include <olectl.h>

参考资料:

https://social.msdn.microsoft.com/Forums/en-US/5ae2ed97-66cc-4dd8-ad88-4245f93d7628/error-midl2311-statements-outside-library-block-are-illegal-in-mktyplib-compatability-mode?forum=vcgeneral

posted @ 2015-11-25 17:56  rldts  阅读(1860)  评论(0编辑  收藏  举报