IMAGE_FILE_NET_RUN_FROM_SWAP in Delphi XE7

2019-09-05 02:48发布

By writing a portable WIn32 app I want to make sure that all the proper settings are done.

I googled for it and found the compiler IMAGE_FILE_NET_RUN_FROM_SWAP switch.

I tried to include it in my dpr file just like this:

{$SetPEFlags IMAGE_FILE_NET_RUN_FROM_SWAP} // THIS ONE!
{$R *.dres}
{$R *.res}

Anyway Delphi XE7 says

[dcc32 Error] Project1.dpr(330): E2003 Undeclared identifier: 'IMAGE_FILE_NET_RUN_FROM_SWAP'

Anyway by reading Embarcaero wiki it seems the name is fine.

Any suggestion?

1条回答
三岁会撩人
2楼-- · 2019-09-05 03:28

Just include Winapi.Windows in your uses clause (this is where IMAGE_FILE_NET_RUN_FROM_SWAP is declared):

uses
  Winapi.Windows, ...

{$R *.dres}
{$R *.res}
{$SetPEFlags IMAGE_FILE_NET_RUN_FROM_SWAP}
查看更多
登录 后发表回答