I am writing some software that deals with internet interfaces. I have written a class that calls GetInterfaceInfo followed by GetIfEntry to get information on each of the interfaces:
sysList = Interface::Discover();
The Interface class contains the name, index, broadcast address etc. of each interface. I have tested my class and it is correctly returning all the interfaces on the system. For compatibility with other classes it is necessary that I have a method in my interface class that returns the name of the interface as a string. However, in the microsoft documentation: (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rras/rras/mib_ifrow.asp
) it says that the name of the interface is returned as an array of wide characters: WCHAR wszName[MAX_INTERFACE_NAME
Is there any way to print the interface name so that I can verify that it has been returned correctly? (I have tried printf, wprintf, wcout etc with a variety of options however they always either return nothing or a string of about 500 identical characters).
Having verified that the interface name is being returned correctly, is there any way to convert from wide characters to characters so that my method can return a string of charaters??