gpt4 book ai didi

windows - System.StackOverflow 错误

转载 作者:可可西里 更新时间:2023-11-01 11:20:26 24 4
gpt4 key购买 nike

我正在对一个用 VB.net 编写的现有 Windows 应用商店应用程序进行更新。我制作了一个共享 MsgBox() 函数和一个“非共享”函数(将从共享函数运行)。我需要共享的,因为我也从另一个类(class)运行它。完整的错误代码:

An unhandled exception of type 'System.StackOverflowException' occurred in Calculator World.exe
The program '[4360] Calculator World.exe: Managed (v4.0.30319)' has exited with code -2147023895 (0x800703e9)

这是 MsgBox 代码:

''' <summary>
''' Shows a message box with a Close button.
'''
''' NOTE: Run "MainPage.MessageBoxDone = false" before running this function!!!
''' </summary>
''' <param name="text">The text to show in the message box.</param>
Public Shared Sub MsgBox(ByVal text As String)'<--- error is occurring ether here
MsgBox(text) ' <--- or here
End Sub

Private Sub MsgBox_unShared(ByVal txt As String)
Canvas_MsgBox.Visibility = Windows.UI.Xaml.Visibility.Visible
Label_MsgBox.Text = txt
End Sub

最佳答案

您的 MsgBox 函数调用自身 - 导致无限递归,从而导致堆栈溢出。您可能想让 MsgBox 调用 MsgBox_unShared

关于windows - System.StackOverflow 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13551894/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com