I am writing a function to decode Microsoft's digital product id from the registry using .NET's RegistryKey class. The function call works properly and returns an Object^. When I examine this object in the debugger, it shows it as a System::Array with 164 elements, which is perfect. My problem is how to convert the Object into some kind of BYTE array so I can continue decoding the digital id. I have tried everything that I can think of ... boxing.. unboxing... casting... tostring()... iteration... Nothing works! I've scoured the Internet and find tons of references if I was using VB or C#, but nothing about C++. I hope that someone can help! It is making me CrAzY!!!
Object ^o = lm->OpenSubKey("ABOHHIVE\\Microsoft\\Windows NT\\CurrentVersion")->GetValue("DigitalProductId")
How can I convert it to an array of BYTES?