Vb6 使用…End With语句从内部调用的函数获取返回值

Vb6 使用…End With语句从内部调用的函数获取返回值,vb6,Vb6,在我的一个事件中,我使用了“With…End With Statement”,因此我需要从“With…End With Statement”中使用的方法中获取返回值 用我的第一种方法,我可以像 Dim RetVal As MyApp.ErrorConstants RetVal = AgentApp.Login(txtUserName, txtPassword, txtStation) 之后,我将把代码改为With…End With Statement“,以及如何获取返回值 Dim RetVal

在我的一个事件中,我使用了“With…End With Statement”,因此我需要从“With…End With Statement”中使用的方法中获取返回值

用我的第一种方法,我可以像

Dim RetVal As MyApp.ErrorConstants
RetVal = AgentApp.Login(txtUserName, txtPassword, txtStation)
之后,我将把代码改为With…End With Statement“,以及如何获取返回值

Dim RetVal As MyApp.ErrorConstants

With AgentApp
    .Login txtUserName, txtPassword, txtStation
    .DisplayMessages = 0
    .UISettings.SuppressErrors = False
    .UISettings.SuppressMessages = False
End With
我们可以这样试试

Dim RetVal As MyApp.ErrorConstants

With AgentApp
   RetVal = .Login(txtUserName, txtPassword, txtStation)
    .DisplayMessages = 0
    .UISettings.SuppressErrors = False
    .UISettings.SuppressMessages = False
End With
我们可以这样试试

Dim RetVal As MyApp.ErrorConstants

With AgentApp
   RetVal = .Login(txtUserName, txtPassword, txtStation)
    .DisplayMessages = 0
    .UISettings.SuppressErrors = False
    .UISettings.SuppressMessages = False
End With