... _LocalAddr => _GetRefToDllFunction("$Path2Dll", 'AdsGetLocalAddress', 'S', 'N'), ... Win32::API::Struct->typedef( AmsNetId => qw( UCHAR b[6]; ) ); Win32::API::Struct->typedef( AmsAddr => qw( AmsNetId netId; USHORT port; ) ); Win32::API->Import("$self->{_Path2Dll}" => 'LONG AdsGetLocalAddress(LPAmsAddr pt)'); my $pt = Win32::API::Struct->new('AmsAddr'); AdsGetLocalAddress($pt);