How can I correctly typecast to a structure in Delphi? This does not work exactly like in C++
where one would just pass a &Data
according to the MSDN documentation.
program Project1;
uses
System.SysUtils,
Winapi.Windows,
Winapi.Winsock2;
function WSAStartup(wVersionRequired: WORD; out lpWSAData: LPWSADATA): Integer; WINAPI; external 'ws2_32.dll';
var
Data: WSADATA;
begin
WSAStartup(WINSOCK_VERSION, LPWSADATA(@Data)); // E2197 Constant object cannot be passed as var parameter
ReadLn;
end.