Delphi 2007:如何设置TSAWARE? [英] Delphi 2007 : How to Set TSAWARE?

查看:251
本文介绍了Delphi 2007:如何设置TSAWARE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Delphi 2009中,您可以将此行添加到您的项目.dpr中,以在应用程序可执行文件中设置TSAWARE PE标志:

In Delphi 2009 and up you can add this line to your project .dpr to set the TSAWARE PE flag in your application executable:

{$SetPEOptFlags  IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE}

我以为(错误地)Delphi中不支持这种语法我有一个应用程序,我不能从2007年到更新的Delphi版本(任务正在进行中,但不会在未来几个月内完成)。

I thought (wrongly) that this syntax is not supported in Delphi 2007. I have an application that I cannot port from 2007 to a newer Delphi version just yet (the task is underway, but it will not be done in the next few months).

更新,只是Windows必须添加到项目.dpr。

Update it was simply that Windows must be added to the project .dpr also.

推荐答案

我的猜测是你从.dpr文件的uses子句中缺少 Windows 单元。添加它,你可以写:

My guess is that you are missing the Windows unit from your .dpr file's uses clause. Add that and you will be able to write:

{$SetPEOptFlags IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE}

虽然很明显你需要在uses子句之后编写它。

in your .dpr file. Although clearly you need to write it after the uses clause.

$ SetPEOptFlags 功能之前添加了一些版本Delphi 2007.所以你可能会看到的错误就是没有声明 IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 。并且通过确保符号在.dpr文件中可见而得到解决。很明显,你可以通过在.dpr文件中声明一个常量,但是为避免重复,我总是喜欢添加Windows单元。

The $SetPEOptFlags feature was added a few versions before Delphi 2007. And so the error that you are presumably seeing is simply that IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE is not declared. And that is solved by making sure that the symbol is visible in the .dpr file. Clearly you can do that by declaring a constant in the .dpr file, but to avoid duplication I always prefer to add the Windows unit.

这篇关于Delphi 2007:如何设置TSAWARE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆