Problems with the mouse cursor!!!?

Hello.I have tried to change mouse cursor in my directx application.I used the following code:

this.Cursor = new Cursor(GetType(), "Cursor1.Cur"); // after I added cursor1 to my project of course.

I receive the following error:
An unhandled exception of type 'System.NullReferenceException' occurred in System.Windows.Forms.dll
Managed Debugging Assistant 'LoaderLock' has detected a problem in 'F:\Visual Studio 2005\Projects\The City\The City\bin\Debug\The City.vshost.exe'.
Additional Information: DLL 'F:\WINDOWS\assembly\GAC\Microsoft.DirectX.Direct3D\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.Direct3D.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.

Why?

[849 byte] By [johnny_no1_boy] at [2007-12-25]
# 1

If only you had googled LoaderLock, or even searched these forums for loader lock.....

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=114707 (2nd in google, 2nd in forum search)

http://www.thezbuffer.com/articles/304.aspx (3rd in google)

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=114901&SiteID=1 (1st in forum search)

Please try to search for your problems before askign questions that may have been asked many, many times

TheZMan at 2007-9-3 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...