1
votes

I am trying to make a plugin system all by using Delphi XE2 via the Firemonkey framework. The issue is that I am getting the error GetProcAddress is undeclared identifier. 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.

Thanks

3

3 Answers

4
votes

When you compile the application for Windows, use Winapi.Windows.GetProcAddress. If not, use System.SysUtils.GetProcAddress. The uses clause in that case should look like this:

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

GetProcAddress is a Windows API system call.
For this reason it has no place in a cross platform FMX application.

If you only want you app to run on Windows, you can add the unit where GetProcAddress is defined to the uses clause.

From: http://docwiki.embarcadero.com/RADStudio/en/Libraries_and_Packages

add Windows to the uses clause.

what is the difference between VCL and Firemonkey when talking about GetProcAddress

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.

0
votes

On OS X, neither the Loadlibray nor GetProcaddress function is defined in the sysutils - both functions are exclusively included in a POSIX definition.