我想知道如何将“PWSTR”转换为“System::String^”
My code snippet follows here...
array<System::String^>^ nsRecords;
try
{
nsRecordCount = dns.query(ipAddressString);
nsRecords = gcnew array<System::String^>(nsRecordCount);
for(int nsRecord = 0; nsRecord < nsRecordCount; nsRecord++)
{
DNS_PTR_DATA record = dns.getNth(nsRecord);
// below line of code causing error C2440: '=' :
//cannot convert from 'PWSTR' to 'System::String ^'
nsRecords[nsRecord] = record.pNameHost;
}
}
我感谢您的帮助!
谢谢, 拉马尼