I've been able to load in a .cur file as a resource by right clicking on
'Resource Files" in the Solution Explorer, choosing
'Add.....Resource....Import then brows to .CUR file and Open it. I save
projects, and it's now one of my Resources.
But, how do I now use this .cur resource as a Cursor? This is what MSDN2
says to do (link included):
this->Cursor = gcnew System::Windows::Forms::Cursor(
GetType(),"MyCursor.Cur" );
http://msdn2.microsoft.com/en-us/library/cyw4de71.aspx
[NOTE: the above code is within the definition of a custom Form class
derived from the generic Form class]
This line compiles, but when run I get the typical
"'System.NullReferenceException". I'm aware the .cur name is case-sensitive.
In my case the cursor file is called 'cursor2.cur'. The MSDN2 page says I'm
suppose to make the .cur file an 'embedded' resource, but the instructions
they give must be outdated, they refer to options that apparently no longer
exist (e.g., can't find a 'Build Action' option to set to 'Embedded').
Since MSDN2 is either giving wrong or incomplete info on this, I need help.
I want to be able to both use a .cur file I construct externally (using a
3rd party tool I just found called ArtCursors) and construct a bitmap at run
time and use it as a cursor. Help with either of both problems will be most
appreciated! : )
[==P==]