내가 옥시 젼 .NET 에서 프로그램을 쓰고 있어요 어떻게 처리하고 nullable 형식 이상한 CLR 오류 동안
namespace RULER;
interface
uses
System,
System.Drawing,
System.Collections,
System.Collections.Generic,
System.Windows.Forms,
System.ComponentModel;
type
/// <summary>
/// Summary description for Settings.
/// </summary>
Settings = public partial class(System.Windows.Forms.Form)
private
method Settings_Shown(sender: System.Object; e: System.EventArgs);
method GetLowerBound : System.Nullable<Double>;
method SetLowerBound(lowerbound:System.Nullable<Double>);
method Settings_Load(sender: System.Object; e: System.EventArgs);
method btnOK_Click(sender: System.Object; e: System.EventArgs);
protected
method Dispose(aDisposing: Boolean); override;
public
property LowerBound : System.Nullable<Double> read GetLowerBound write SetLowerBound;
constructor;
end;
implementation
{$REGION Construction and Disposition}
constructor Settings;
begin
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
end;
method Settings.Dispose(aDisposing: Boolean);
begin
if aDisposing then begin
if assigned(components) then
components.Dispose();
//
// TODO: Add custom disposition code here
//
end;
inherited Dispose(aDisposing);
end;
{$ENDREGION}
method Settings.Settings_Shown(sender: System.Object; e: System.EventArgs);
begin
LowerBound := System.Nullable<Double>(Controller.configuration.LowerBound);
end;
method Settings.GetLowerBound : System.Nullable<Double>;
begin
var bound : Double;
if Double.TryParse(txtLowerBound.Text, out bound) then
begin
Result := bound;
end else
begin
Result := System.Nullable<Double>(nil);
end;
end;
method Settings.SetLowerBound(lowerbound:System.Nullable<Double>);
begin
if lowerbound.HasValue then
begin
txtLowerBound.Text := lowerbound.Value.ToString;
end else
begin
txtLowerBound.Text := '';
end;
end;
method Settings.Settings_Load(sender: System.Object; e: System.EventArgs);
begin
end;
method Settings.btnOK_Click(sender: System.Object; e: System.EventArgs);
begin
var LB : System.Nullable<Double> := Self.GetLowerBound;
if LB.HasValue then
begin
Controller.configuration.LowerBound := LB.Value;
end;
end;
end.
내가 버튼을 클릭
에 문제가 발생한 것 같습니다 btnOK_Click 이벤트가 발생했습니다. 이상한 오류 메시지가 나타납니다.런타임에 치명적인 오류가 발생했습니다. 오류 의 주소는 0x691886da이고 스레드 0x770에있었습니다. 오류 코드는 0xc0000005입니다. 이 오류는 CLR 또는 안전하지 않거나 확인할 수없는 사용자 코드의 버그 일 수 있습니다. 이 버그의 일반적인 소스에는 COM- interop 또는 PInvoke에 대한 사용자 지정 오류 ( 스택 손상 될 수 있음)가 포함됩니다. 이 m의 UCH는 더 투명 작품으로
은 버그로 우리의 내부 버그 데이터베이스에 로그인 : // 61996 : "런타임에 치명적인 오류가 발생했습니다." nullable 캐스트가있는 경우 –
미래에 버그 리포트를 제출할 수있는 가장 좋은 곳은 어디입니까? – sav
remomjects.com의 이메일 지원 @ –