when I compile this project: convert MFC control to ActiveX demo, ran into this error:
Error MIDL2311 statements outside library block are illegal in mktyplib compatability mode : [ ] AxShadeButton C:\Demo_Temp\axshadebutton\AxShadeButton.odl 1
- Error MIDL2311 : statements outside library block are illegal in mktyplib compatability mode
- Midl compiler error: 2214
- error MIDL2311 : statements outside library block are illegal in mktyplib compatability mode
- Creating an ActiveX Button from an MFC owner-draw Button
- CQuantizer
- Drawing Lines, Shapes, or Text on Bitmaps
- CxSkinButton
I tested this solution and it is working:
How do you use windows 10 SDK with VS 2012? It is better to use VS 2015 with windows 10 SDK.
I suggest you don't use /mktyplib203. Try go to project properties -> MIDL->MkTypeLib Compatible -> No.
If you still get this error, it is better to post the part of your IDL code that causes the error here. If possible, please create a simple sample to reproduce this issue and post the reproduce steps here.
the last comment is good one:
I was getting the same error when trying to compile an OCX project that was upgraded in VS2013. I had to open the .odl file and move the #include statements inside the library block.
No comments:
Post a Comment