标签: visual-c++ using
我正在尝试使用isKeyLocked函数,但根据Microsoft的C ++示例,我需要使用#using <System.Windows.Forms.dll>。如果我这样做,我的程序会抛出编译时错误。
#using <System.Windows.Forms.dll>
Here's the source of the example.
答案 0 :(得分:1)
您应该在托管C ++模式下编译。
转到Project Properties,General并将Common Language Runtime support设为/clr, 或者从命令行,
Project Properties
General
Common Language Runtime support
/clr
cl.exe main.cpp /clr