VB code snippet for using the generalFormResponse module


Private Sub Form_Load()

On Error GoTo Err_Trap

Dim bStatus As Boolean

'### GeneralFormResponseManager interface
Dim generalFormRequestManagerEx As GENERALFORMRESPONSEMANAGER430Lib.GeneralFormResponseManager
Set generalFormRequestManagerEx = New GeneralFormResponseManager

'### GeneralFormResponse interface
Dim generalFormResponseEx As GeneralFormResponse


Dim strXML As String
Dim strXSD As String
Dim lVersion As Long
Dim strFromEAN As String
Dim strToEAN As String
Dim bIsEncrypted As YesNoType

strXML = "ResponseG430_Reject01.xml"

bStatus = generalFormRequestManagerEx.GetXMLInfo(strXML, strXSD, strFromEAN, strToEAN, bIsEncrypted)
If bStatus And Not bIsEncrypted Then

    bStatus = generalFormRequestManagerEx.LoadXML(strXML, "", "", generalFormResponseEx)
    If bStatus Then
        Dim strCode As String
        Dim strText As String
        Dim bIsAnError As YesNoType
        Dim lRecordID As Long
        Dim strErrorValue As String
        Dim strValidValue As String
        Dim strOutput As String
        strOutput = ""
        bStatus = generalFormResponseEx.GetFirstNotification(strCode, strText, bIsAnError,  _
                                                             lRecordID, strErrorValue, strValidValue)
        If bStatus Then
                strOutput = strOutput + "strCode=[" + strCode + "]strText=[" + strText + "]strErrorValue=[" + _
                            strErrorValue + "]strValidValue=[" + strValidValue + "]" + vbCrLf
            Do While generalFormResponseEx.GetNextNotification(strCode, strText, bIsAnError,  _
                                                               lRecordID, strErrorValue, strValidValue)
                                                               
                strOutput = strOutput + "strCode=[" + strCode + "]strText=[" + strText + "]strErrorValue=[" +  _
                            strErrorValue + "]strValidValue=[" + strValidValue + "]" + vbCrLf
            Loop
            MsgBox (strOutput)
        End If
    End If

End If

'### relase resources
Set generalFormResponseEx = Nothing
Set generalFormRequestManagerEx = Nothing

Exit Sub

Err_Trap:
    MsgBox "Error: " & Err.Description, vbCritical, _
           "Opps! Error" & Str$(Err.Number)

'### relase resources
Set generalFormResponseEx = Nothing
Set generalFormRequestManagerEx = Nothing

End Sub