ウェブで見つけることができるガイドに従って、foxpro (9 with SP) 用の .net (3.5) COM コントロールを作成しました (たとえば、rick strahls weblog から)。
現在、時々 foxpro で、オブジェクトを解放するときに C000005 が発生します。
そこで、このシナリオを再現しようとしました。オブジェクトを何百回もインスタンス化して解放すると、同じエラーが発生しました。
空の FoxPro SCX フォームと、コードのない単純な .net ボタンを使用します。
.net オブジェクトを破棄しないと、同様の .net 例外「保護されたメモリの読み取りまたは書き込みを試みました」が発生します。
".(完全な例外は下部を参照)
ここに VFP コード:
Local lnAnzahl as Number, ;
lni as Number
set procedure to DummyProcedure.prg
lnAnzahl = val(inputbox("wie oft", "oft","0"))
for lni = 1 to lnAnzahl
thisform.newobject("cntTest","netcontrol","c0005nativetest.vcx")
thisform.RemoveObject("cntTest")
endfor
.net エラー メッセージ
System.AccessViolationException: Es wurde versucht, im geschützten Speicher zu lesen or zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist. System.Runtime.InteropServices.ComTypes.IAdviseSink.OnViewChange(Int32 アスペクト、Int32 インデックス) System.Windows.Forms.Control.ActiveXImpl.ViewChanged() System.Windows.Forms.Control.ActiveXImpl.ViewChangedInternal() System. Windows.Forms.Control.OnInvalidated(InvalidateEventArgs e)
System.Windows.Forms.Control.NotifyInvalidate(Rectangle invalidatedArea) System.Windows.Forms.Control.Invalidate(Boolean invalidateChildren)
System.Windows.Forms.Control.WmUpdateUIState(Message& m) System.Windows.Forms.Control.WndProc(Message& m) System.Windows.Forms.ScrollableControl.WndProc(Message& m) System.Windows.Forms.ContainerControl .WndProc(Message& m) System.Windows.Forms.UserControl.WndProc(Message& m) System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) System.Windows.Forms.Control.ActiveXImpl.System.Windows .Forms.IWindowTarget.OnMessage(Message& m) System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
これは既知の問題ですか? どうすれば解決できるかアドバイスはありますか?