While compiling a VC++ 5.0 code in VC++ .NET 2003, I get the following error
______________________________________________
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\cstringt.h(875) : error C2664: 'PtrToStringChars' : cannot convert parameter 1 from 'unsigned char *' to 'const System::String __gc *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
ServiceRegistry.cpp(90) : see reference to function template instantiation 'ATL::CStringT::CStringT(SystemString *)' being compiled
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL,
SystemString=unsigned char
]
________________________________________________
Here is the function referred to by this error in ServiceRegistry.cpp
______________________________________________
CString CServiceRegistry::GetString(const char * name) const
{
unsigned long type;
unsigned char buf[1024];
unsigned long size=1023;
long res=RegQueryValueEx( Key, name, 0, &type, buf, &size);
if(res==ERROR_SUCCESS ) return buf; //Line 90
else return "";
}
______________________________________________
Can somebody please help?
Thanks
