P/Invoke can actually handle what you’re after most of the time using StringBuilder to create writable buffers, for example see pinvoke.net on GetWindowText and related functions.
However, that aside, with data as ushort, I assume that it is encoded in UTF-16LE. If that is the case you can use Encoding.Unicode.GetString(), but that will exepect a byte array rather than a ushort array. To turn your ushorts into bytes, you can allocate a separate byte array and use Buffer.BlockCopy, something like this:
ushort data = new ushort;
for (int i = 0; i < data.Length; ++i)
data[i] = (char) ('A' + i);
byte asBytes = new byte[data.Length * sizeof(ushort)];
Buffer.BlockCopy(data, 0, asBytes, 0, asBytes.Length);
asString = Encoding.Unicode.GetString(asBytes);
However, if unsafe code is OK, you have another option. Get the start of the array as a ushort*, and hard-cast it to char*, and then pass it to the string constructor, like so:
fixed (ushort *dataPtr = &data)
asString = new string((char *) dataPtr, 0, data.Length);
The web browser version of Google Play Music isn’t exactly full-featured – it pales in comparison even to built-in tools like Windows Media Player or iTunes. But now it has one more tool that’s bringing it a little closer: a visualizer. A visualizer is an overlay that presets a visual accompaniment to a musical track. Some of them get pretty elaborate, some of them aren’t much more than a graphic equalizer. Google Play Music’s first visualizer is called “Particles.”
Today, we’re excited to announce the preview availability of RemoteIE via Azure RemoteApp. This is a free service from Microsoft that allows you to run the latest version of Internet Explorer on the Windows 10 Technical Preview from your Windows, Mac OS X, iOS or Android devices, without the need to run a new OS or heavyweight virtual machine on your device. Going forward, this will be the recommended way for developers who are not running Windows 10 to test the latest IE preview versions.
Speaker Boehner. What a character.
Last night, the President announced he’s taking decisive Executive Action to begin responsibly dealing with the broken immigration system. For months, the President warned House Republicans that if they didn’t act, he would. There is just too much at stake with millions of people living in the shadows and in fear of being separated from their families.
THE HUNGER GAMES: MOCKINGJAY – PART 1
Sure, it makes business sense to stretch the Hunger Games series as far as it can go — but does it make artistic sense? Critics say the answer is a tentative yes; while The Hunger Games: Mockingjay – Part 1 is decidedly short on action, its exceptional cast and intriguing ideas still make for compelling viewing. War is brewing throughout the land, and the skill and compassion that Katniss (Jennifer Lawrence) has displayed in the Hunger Games has made her a folk hero for the rebellion. But while Katniss is uncomfortable in her new role as a symbol, she teams with a band of rebels in order to ensure her family’s safety and rescue her old partner Peeta (Josh Hutcherson) from the Capital. The pundits say The Hunger Games: Mockingjay – Part 1 provides a deeper look into the trials and tribulations of District 13, even if it sometimes feels like an extended cliffhanger for the final chapter.
Can you talk about your plans to make Desura a more competitive platform to Steam? Whever I read post-mortems/sales breakdowns, it almost always seems like Steam generates sooo many more sales that Desura isn’t worth publishing on, much less fully integrating. This saddens me, because competition is good, but I’m not sure how tractable the issue really is.