G
Guest
I get this error message from time to time in my new app:
"CallbackOnCollectedDelegate was detected
Message: A callback was made on a garbage collected delegate of type
'System.Windows.Forms!System.Windows.Forms.NativeMethods+WndProc::Invoke'.
This may cause application crashes, corruption and data loss. When passing
delegates to unmanaged code, they must be kept alive by the managed
application until it is guaranteed that they will never be called."
The same code was running without any problems under Visual Studio 2005 Beta
2, but after upgrade to Visual Studio 2005 Professional and the final release
of .NET, I get this error.
Sometimes the code runs without any problems!
What can I do to prevent this from happen?
"CallbackOnCollectedDelegate was detected
Message: A callback was made on a garbage collected delegate of type
'System.Windows.Forms!System.Windows.Forms.NativeMethods+WndProc::Invoke'.
This may cause application crashes, corruption and data loss. When passing
delegates to unmanaged code, they must be kept alive by the managed
application until it is guaranteed that they will never be called."
The same code was running without any problems under Visual Studio 2005 Beta
2, but after upgrade to Visual Studio 2005 Professional and the final release
of .NET, I get this error.
Sometimes the code runs without any problems!
What can I do to prevent this from happen?