I'm trying to load one graphic resource (PNG image) which seems to be added to my project (I used 'Add item...' with the file placed at the main path).
The function I made is the next:
Image^ Camera::LoadResource( String^ file, String^ Res){
String^ ressrc = file;
System::Reflection::Assembly^ execAssem = System::Reflection::Assembly::GetExecutingAssembly();
Resources::ResourceManager^ myres = gcnew Resources::ResourceManager(ressrc, execAssem);
Object^ obj = myres->GetObject(Res);
return dynamic_cast<Image^>(obj);
}
But when I check 'obj', it has a null value. This function used to work on another project... what I'm doing wrong this time?
Thank you!