I am getting "Unhandled exception at 0x5DCF4E4e (msvcr1103d.dll) in RakNet_WindowsStore8_VS20212.exe: An invalid parameter was passed to a function that considers invalid parameters fatal."
What am I doing wrong?
Code:
DatagramSocket ^listener = ref new DatagramSocket();
HostName ^hostName = ref new HostName(ref new Platform::String(L"microsoft.com"));
task< Windows::Foundation::Collections::IVectorView<EndpointPair^>^ > op(listener->GetEndpointPairsAsync(hostName, L"0"));
op.wait();
Windows::Foundation::Collections::IVectorView<EndpointPair^>^view = op.get();
if (view->Size>0)
{
Platform::String ^name = view->GetAt(0)->RemoteHostName->DisplayName;
RakString rs2;
rs2.FromWideChar(name->Data());
strcpy(ip, rs2.C_String());
}
else
{
ip[0]=0;
}