VB6(visual basic 6.0)程序求注释m14,谢谢
PublicSubTranslateError()OnErrorResumeNextExitSubDimlRetAsLonglRet=DdeGetLastError(g_...
Public Sub TranslateError()
On Error Resume Next
Exit Sub
Dim lRet As Long
lRet = DdeGetLastError(g_lInstID)
Select Case lRet
Case DMLERR_NO_ERROR
MsgBox "DMLERR_NO_ERROR"
Case DMLERR_ADVACKTIMEOUT
MsgBox "DMLERR_ADVACKTIMEOUT"
Case DMLERR_BUSY
MsgBox "DMLERR_BUSY"
Case DMLERR_DATAACKTIMEOUT
MsgBox "DMLERR_DATAACKTIMEOUT"
Case DMLERR_DLL_NOT_INITIALIZED
MsgBox "DMLERR_NOT_INITIALIZED"
Case DMLERR_DLL_USAGE
MsgBox "DMLERR_USAGE"
Case DMLERR_EXECACKTIMEOUT
MsgBox "DMLERR_EXECACKTIMEOUT"
Case DMLERR_INVALIDPARAMETER
MsgBox "DMLERR_INVALIDPARAMETER"
Case DMLERR_LOW_MEMORY
MsgBox "DMLERR_LOW_MEMORY"
Case DMLERR_MEMORY_ERROR
MsgBox "DMLERR_MEMORY_ERROR"
Case DMLERR_NOTPROCESSED
MsgBox "DMLERR_NOTPROCESSED"
Case DMLERR_NO_CONV_ESTABLISHED
MsgBox "DMLERR_NO_CONV_ESTABLISHED"
Case DMLERR_POKEACKTIMEOUT
MsgBox "DMLERR_POKEACKTIMEOUT"
Case DMLERR_POSTMSG_FAILED
MsgBox "DMLERR_POSTMSG_FAILED"
Case DMLERR_REENTRANCY
MsgBox "DMLERR_REENTRANCY"
Case DMLERR_SERVER_DIED
MsgBox "DMLERR_SERVER_DIED"
Case DMLERR_SYS_ERROR
MsgBox "DMLERR_SYS_ERROR"
Case DMLERR_UNADVACKTIMEOUT
MsgBox "DMLERR_UNADVACKTIMEOUT"
Case DMLERR_UNFOUND_QUEUE_ID
MsgBox "DMLERR_UNFOUND_QUEUE_ID"
End Select
End Sub 展开
On Error Resume Next
Exit Sub
Dim lRet As Long
lRet = DdeGetLastError(g_lInstID)
Select Case lRet
Case DMLERR_NO_ERROR
MsgBox "DMLERR_NO_ERROR"
Case DMLERR_ADVACKTIMEOUT
MsgBox "DMLERR_ADVACKTIMEOUT"
Case DMLERR_BUSY
MsgBox "DMLERR_BUSY"
Case DMLERR_DATAACKTIMEOUT
MsgBox "DMLERR_DATAACKTIMEOUT"
Case DMLERR_DLL_NOT_INITIALIZED
MsgBox "DMLERR_NOT_INITIALIZED"
Case DMLERR_DLL_USAGE
MsgBox "DMLERR_USAGE"
Case DMLERR_EXECACKTIMEOUT
MsgBox "DMLERR_EXECACKTIMEOUT"
Case DMLERR_INVALIDPARAMETER
MsgBox "DMLERR_INVALIDPARAMETER"
Case DMLERR_LOW_MEMORY
MsgBox "DMLERR_LOW_MEMORY"
Case DMLERR_MEMORY_ERROR
MsgBox "DMLERR_MEMORY_ERROR"
Case DMLERR_NOTPROCESSED
MsgBox "DMLERR_NOTPROCESSED"
Case DMLERR_NO_CONV_ESTABLISHED
MsgBox "DMLERR_NO_CONV_ESTABLISHED"
Case DMLERR_POKEACKTIMEOUT
MsgBox "DMLERR_POKEACKTIMEOUT"
Case DMLERR_POSTMSG_FAILED
MsgBox "DMLERR_POSTMSG_FAILED"
Case DMLERR_REENTRANCY
MsgBox "DMLERR_REENTRANCY"
Case DMLERR_SERVER_DIED
MsgBox "DMLERR_SERVER_DIED"
Case DMLERR_SYS_ERROR
MsgBox "DMLERR_SYS_ERROR"
Case DMLERR_UNADVACKTIMEOUT
MsgBox "DMLERR_UNADVACKTIMEOUT"
Case DMLERR_UNFOUND_QUEUE_ID
MsgBox "DMLERR_UNFOUND_QUEUE_ID"
End Select
End Sub 展开
1个回答
展开全部
错误代码的翻译,
上面的代码没有实际的意义,
Exit Sub '退出当前过程,下面的代码不再执行,所以没有意义了。
你可以这样理解,On Error Resume Next '有错误仍然继续
如果去了EXIT SUB ,那下面的代码可用,作如下解释
lRet = DdeGetLastError(g_lInstID) '这是执行一个自定义的过程,得到一个错误代码。
后面的select case 是看lRet =那个错误代码值,显示一个错误代码名称。
上面的代码没有实际的意义,
Exit Sub '退出当前过程,下面的代码不再执行,所以没有意义了。
你可以这样理解,On Error Resume Next '有错误仍然继续
如果去了EXIT SUB ,那下面的代码可用,作如下解释
lRet = DdeGetLastError(g_lInstID) '这是执行一个自定义的过程,得到一个错误代码。
后面的select case 是看lRet =那个错误代码值,显示一个错误代码名称。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询