简体   繁体   English

FireMonkey应用程序中未声明的标识符“ GetProcAddress”

[英]Undeclared identifier 'GetProcAddress' in a FireMonkey Application

I am trying to make a plugin system all by using Delphi XE2 via the Firemonkey framework. 我试图通过Firemonkey框架使用Delphi XE2来制作一个插件系统。 The issue is that I am getting the error GetProcAddress is undeclared identifier. 问题是我收到错误GetProcAddress是未声明的标识符。 When I attempt to use GetProcAddress in a VCL project everything works fine, so what is the difference between VCL and Firemonkey when talking about GetProcAddress and how to use it in a Firemonkey App. 当我尝试在VCL项目中使用GetProcAddress时,一切正常,因此在谈论GetProcAddress以及如何在Firemonkey App中使用它时,VCL和Firemonkey有什么区别。

Thanks 谢谢

When you compile the application for Windows, use Winapi.Windows.GetProcAddress. 为Windows编译应用程序时,请使用Winapi.Windows.GetProcAddress。 If not, use System.SysUtils.GetProcAddress. 如果不是,请使用System.SysUtils.GetProcAddress。 The uses clause in that case should look like this: 在这种情况下,uses子句应如下所示:

uses
{$IFDEF MSWINDOWS}
  Winapi.Windows,
{$ENDIF}
  System.SysUtils;

GetProcAddress is a Windows API system call. GetProcAddress是Windows API系统调用。
For this reason it has no place in a cross platform FMX application. 因此,它在跨平台FMX应用程序中没有位置。

If you only want you app to run on Windows, you can add the unit where GetProcAddress is defined to the uses clause. 如果只希望您的应用程序在Windows上运行,则可以将在其中定义了GetProcAddress的单元添加到uses子句。

From: http://docwiki.embarcadero.com/RADStudio/en/Libraries_and_Packages 来自: http : //docwiki.embarcadero.com/RADStudio/zh/Libraries_and_Packages

add Windows to the uses clause. Windows添加到uses子句。

what is the difference between VCL and Firemonkey when talking about GetProcAddress 谈论GetProcAddress时,VCL和Firemonkey有什么区别

The VCL is bound specifically to Windows, Firemonkey (aka FMX) is made to be cross platform and for this reason does not add windows to its default uses clause. VCL是专门绑定到Windows的,Firemonkey(又名FMX)是跨平台的,因此不会在其默认use子句中添加windows

在OS X上,sysutils中都没有定义Loadlibray和GetProcaddress函数-这两个函数都专门包含在POSIX定义中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM