I've got everything going nearly except one line of code. I think I'm in
over my head here so, I'm going to ask for some help.
Basically what the preposal is that you will be able to open a folder browse
dialogue with a root other than those specified in
Environment::SpecialFolders::. and I'm hoping that I would be able to
specify network as the root and the defaultpath as the usersdomain much like
it is done on mstsc.exe (RDT)
Only one snag I can't get this line of reflection code to pan.
I got this code reference and I've tried to put into C++.
FieldInfo fi = t.GetField("rootFolder", BindingFlags.Instance |
BindingFlags.NonPublic);
fi.SetValue(fbd, (System.Environment.SpecialFolder) csidl);
Type * t = fbd->GetType();
FieldInfo * fi = t->GetField("rootFolder",
((BindingFlags)(BindingFlags::Instance | BindingFlags::NonPublic)));
//This line didn't always used to be so nasty but it basically all
comes down to the fourth argument
// fi->SetValue(fbd, S"rootFolder",
((BindingFlags)(BindingFlags::Instance | BindingFlags::NonPublic)),
(System::Environment::SpecialFolder) csidl, new
System::Globalization::CultureInfo("en-US",false));
//fi->SetValue(fbd, (System::Environment::SpecialFolder) csidl );
This line returns the error:
error C2664: 'void System::Reflection::FieldInfo::SetValue(System::Ob ject
__gc *,System::Object __gc *)' : cannot convert parameter 2 from
'System::Reflection::BindingFlags' to 'System::Object __gc *'
refer here for complete reference code.
I need to know if this is all in vein or can it be done!
If so is this the right approach?
-=Chad=-