I am having problems with the syntax in c++/cli when I try to define a c++/cli value struct as a TValue in a Dictionary
I am doing this because I want to maintain a map between a native class pointer and a system::String (with String as the key), so have wrapped the native pointer in a struct.
value struct MyStruct
{
NativeClass *m_p;
}
Dictionary<System::String ^, MyStruct> MyMap;
NativeClass* FindLigandModelMap(System::String ^file)
{
MyStruct m;
if (m_LigandToModelMap.TryGetValue(file, %m)) <--- ERROR HERE
return(m.m_p);
return(NULL);
}
Thi gives a compiler error: error C2664: 'System::Collections::Generic::Dictionary::TryGetValue' : cannot convert parameter 2 from 'MyStruct ^' to 'MyStruct %'
I have tried various declarations of MyStruct with no success.