2010-11-23 7 views
0

Visual Studio 2010을 사용하여 VB.NET에서 만든 첫 번째 XAML 응용 프로그램에 문제가 있습니다. 실행할 때마다 적용 단추를 클릭하고 싶습니다 (일부 필드에서 데이터를 입력하려고합니다. 적용 단추를 클릭하면 입력 한 내용의 messagebox.show가 표시됨) 프로그램이 충돌합니다. 나는 Windows 7 x64 궁극적 인 판을 달리고있다. 어떤 아이디어?프로그램이 예기치 않게 종료 됨

이벤트 로그 아래 보여

오류있는 응용 프로그램 이름 : CreditCard.exe 버전 : 1.0.0.0, 타임 스탬프 : 0x4ceafa3a 오류있는 모듈 이름 : KERNELBASE.dll 버전 : 6.1.7600.16385, 타임 스탬프 : 예외 코드 0x4a5bdbdf : 0xe0434352 오류 오프셋 : 0x0000b727 오류있는 프로세스 ID : C : Chohan \ 문서가 프로젝트 \ 비주얼 스튜디오 2010 \ \ \ 사용자 \ 6 장 \ 크레딧 카드 \의 크레딧 카드 응용 프로그램 경로를 오류있는 0x01cb8b5a4900b2cb : 0x14d0 오류있는 응용 프로그램 시작 시간 \ bin \ Debug \ CreditCard.exe 오류가있는 모듈 경로 : C : \ Windows \ syswow64 \ KERNELBASE.dll,보고서 ID : 8eba45a2-f74d-11df-8e1c-506313a0ad71 또한


:

응용 프로그램 : CreditCard.exe 프레임 워크 버전 : v4.0.30319 설명 : 프로세스 처리되지 않은 예외로 인해 종료되었습니다 . 예외 정보 : System.InvalidCastException 스택 : Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble (선택 System.String, System.Globalization.NumberFormatInfo) 에서 Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble (선택 System.String) 에서의 System.Windows.EventRoute.InvokeHandlersImpl에서 System.Windows.RoutedEventHandlerInfo.InvokeHandler에서 CreditCard.MainWindow.btnApply_Click (은 System.Object, System.Windows.RoutedEventArgs) (은 System.Object, System.Windows.RoutedEventArgs) (은 System.Object, System.Windows.RoutedEventArgs, Boolean) 에서 System.Windows.UIElement.RaiseEventImpl (System.Windows.DependencyObject, System.Windows.RoutedEventArgs) at System.Windows.UIElement.RaiseEvent (System.Windows.RoutedEvent Arg)) System.Windows.Controls.Primitives.ButtonBase. MouseButtonEventArgs) System.Windows에서 System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler에서 System.Windows.UIElement.OnMouseLeftButtonUpThunk (은 System.Object, System.Windows.Input.MouseButtonEventArgs) (System.Delegate,은 System.Object) 에서 . RoutedEventArgs.InvokeHandler (System.Delegate, System.Object) (System.Windows.RoutedEventHandlerInfo.InvokeHandler (System.Object, System.Windows.RoutedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl (System.Object, System.Windows. RoutedEventArgs, Boolean) 에서 System.Windows.UIElement.ReRaiseEventAs (System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent) at System.Windows.UIElement.OnMouseUpThunk (System.Object, System.Windows.Input.MouseButtonEventArgs) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler (System.Delegate, System.Object) at System.Windows.RoutedEventArgs.InvokeHandler (System.Delegate, System.Object) at System.Windows.RoutedEventHandlerInfo.InvokeHandler (System. Object, System.Windows.RoutedEventArgs) (System.Windows.EventRoute.InvokeHandlersImpl (System.Object, System.Windows.RoutedEventArgs, Boolean) at System.Windows.UIElement.RaiseEventImpl (System.Windows.DependencyObject, System.Windows.RoutedEventArgs) System.Windows.UIElement.RaiseTrustedEvent (System.Windows.RoutedEventArgs에서 ) System.Windows.Input.InputManager.ProcessStagingArea에서 System.Windows.UIElement.RaiseEvent (System.Windows.RoutedEventArgs, 불리언) 에서 () (시스템 이벤트 컨트롤) (IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage (IntPtr, MS.Internal.Interop.WindowMessage, IntPtr , IntPtr, Boolean ByRef) at System.Windows.Interop.HwndSo Microsoft.Win32.HwndWrapper.WndProc (IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)에서 의 은 Microsoft.Win32.HwndSubclass.DispatcherCallbackOperation (System.Object)에서 에 있습니다. 에서 System.Windows.Threading.ExceptionWrapper.InternalRealCall (System.Delegate, System.Object, Int32) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen (System.Object, System.Delegate, System.Object, Int32, System. 대리자) at System.Windows.Threading.Dispatcher.InvokeImpl (System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) (MS.Win32.HwndSubclass.SubclassWndProc (IntPtr, Int32, IntPtr, IntPtr) at MS.Win32.UnsafeNativeMethods.DispatchMessage (System.Windows.Interop.MSG ByRef) at System.Windows.Threading.Dispatcher.PushFrameImpl (System.Windows.Threading.DispatcherFrame) at System.Windows.Threading.Dispatcher.PushFrame (System.Windows.Threading.DispatcherFrame) (System.Windows.Threading.Dispatcher). System.Windows.Application.Run (System.Windows.Window)에서 System.Windows.Application.RunInternal (System.Windows.Window) 에서 System.Windows.Application.RunDispatcher (은 System.Object) 에서 실행() CreditCard.Application.Main에서 System.Windows.Application.Run() ()

답변

0

실제로 예외 스택을 읽는 경우 오류가 발생합니다.

System.InvalidCastException 스택 : 그것은 당신의 적용 버튼 이벤트 핸들러에서의 Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble에서 Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble (선택 System.String, System.Globalization.NumberFormatInfo) (시스템에서

에서 CreditCard.MainWindow.btnApply_Click (은 System.Object, System.Windows.RoutedEventArgs)에서) 더블에 문자열에서 변환을 .String 것은 제대로

+0

옙 - 알아 냈어 - 내 코딩의 일부로 오자! 백만 번 이상 방문한 다음 단계별로 살펴보고 마침내 깨달았습니다. 도움을 주셔서 감사합니다 - 당신이 내가 있어야하는 곳을 좁히는 것을 도왔다. – lara400

0

에서 당신은 DoubleString를 캐스팅하려고 그것은 예외를 던지고.

ToDouble(System.String, System.Globalization.NumberFormatInfo)

+0

네 처리되지는 - 그것을 알아 냈다 - 망할 오타 내 코드의 일부로! 백만 번 이상 방문한 다음 단계별로 살펴보고 마침내 깨달았습니다. 도움을 주셔서 감사합니다 - 당신이 내가 있어야하는 곳을 좁히는 것을 도왔다. – lara400

0

System.InvalidCastException

당신이 텍스트 상자에 문자열을 inputing 및 정수 또는 더블 당신이 얻을 것 같은 오류로 해석하는 경우.

+0

'TextBox'의'string'이 모두 숫자가 아닌 경우. – Gabe

+0

+1 (답변이 컸기 때문에가 아니라) -1이 약간 가혹한 것처럼 보입니다. 저는 개인적으로 알리가 말했던 것이 분명하고 -1의 가치가 없다고 생각합니다. – Sheridan

관련 문제