How to access custom resources?
I've just started to use Visual C++ 2005 Express, and don't know how to access embedded resources.
I created CLR Empty project, added MainForm.h and MainForm.cpp files under Solution-->Project-->Header Files/Source Files, respectively. Then - an icon under Solution-->Project-->Resource files-->"icon.ico". Then I put some code:
MainForm::MainForm(void) It compiles and builds OK. However, when I run it form within IDE, it gives me:
{
// That is my custom icon I want to use
this->Icon =gcnew System::Drawing::Icon(this->GetType(),"icon.ico");
}
An unhandled exception of type 'System.ArgumentException' occurred in System.Drawing.dll Additional information: Resource 'icon.ico' cannot be found in class 'MyNamespace.MainForm'. |
Apparently, something is wrong with how I reference this resource in my code, right? I was not able to find any workarounds in the help supplied.
Can anyone help me with that?
Thanks in advance.
besserer

