In C ++, if you try to get a pointer to a function of a Windows API function, this pointer points to the same address that you would get if you used GetProcAddress for the name of this function and the corresponding module. For example:
&MessageBoxA == GetProcAddress("User32.dll", "MessageBoxA");
will be true . However, in Delphi this is not so. This code:
@MessageBoxA = GetProcAddress('User32.dll', 'MessageBoxA');
It would not be true , and in my test @MessageBoxA was 0x0040bd18 , while the equivalent GetProcAdress returned what the C ++ test instance did, 0x7550fd1e .
So now for my question: why?
winapi delphi delphi-2010 getprocaddress
み っ つ
source share