In C++, if you try to get a function pointer of a Windows API function, that pointer points to the same address you would get if you used GetProcAddress
on the name of that function and it's respective module. For example:
&MessageBoxA == GetProcAddress("User32.dll", "MessageBoxA");
would be true
. However, in Delphi, that is not the case. This code:
@MessageBoxA = GetProcAddress('User32.dll', 'MessageBoxA');
Would not be true
, and in my test, @MessageBoxA
was 0x0040bd18
while the equivalent GetProcAdress
returned what the test's C++ counterpart did, 0x7550fd1e
.
So now for my question: why?