如何在c ++中使用“#using”语句?

时间:2011-12-16 23:07:02

标签: visual-c++ using

我正在尝试使用isKeyLocked函数,但根据Microsoft的C ++示例,我需要使用#using <System.Windows.Forms.dll>。如果我这样做,我的程序会抛出编译时错误。

Here's the source of the example.

1 个答案:

答案 0 :(得分:1)

您应该在托管C ++模式下编译。

转到Project PropertiesGeneral并将Common Language Runtime support设为/clr, 或者从命令行,

cl.exe main.cpp /clr