G
Guest
I am trying to develop a managed C++ assembly that returns information in the registry. I am having two problems
1) In the constructor I would like to initialize the registry key using RegOpenKeyEx. But if I have the HKEY value as a private member the compiler complains that HKEY __gc cannot be converted to PHKEY. How do I tell it not to treat it as a managed object? __nogc can only be used for classes
2) I want to build an array from querying the registry keys to I have a property
__property String * get_TimeZoneList() [
ArrayList *names = new ArrayList()
return (String * [])names->ToArray(__typeof(String))
}
Compiling this gives me an error
d:\TimeZone\TimeZone.h(49): error C2440: 'type cast' : cannot convert from 'System::Array __gc *' to 'System::String __gc * __gc[]
Any suggestions on either of these problems
Thank you
Kevi
1) In the constructor I would like to initialize the registry key using RegOpenKeyEx. But if I have the HKEY value as a private member the compiler complains that HKEY __gc cannot be converted to PHKEY. How do I tell it not to treat it as a managed object? __nogc can only be used for classes
2) I want to build an array from querying the registry keys to I have a property
__property String * get_TimeZoneList() [
ArrayList *names = new ArrayList()
return (String * [])names->ToArray(__typeof(String))
}
Compiling this gives me an error
d:\TimeZone\TimeZone.h(49): error C2440: 'type cast' : cannot convert from 'System::Array __gc *' to 'System::String __gc * __gc[]
Any suggestions on either of these problems
Thank you
Kevi