CallbackOnCollectedDelegate was detected

前端 未结 3 2035

I am subclassing an application. My subclassed Window procedure is within a DLL. My subclassing code inside the DLL looks somewhat like this (stripped down, removed other no

3条回答
  •  没有蜡笔的小新
    2020-12-06 05:27

    the callback function can be invoked after the call returns, the managed caller must take steps to ensure that the delegate remains uncollected until the callback function finishes. For detailed information about preventing garbage collection, see Interop Marshaling with Platform Invoke.

    http://msdn.microsoft.com/en-us/library/eaw10et3.aspx

提交回复
热议问题