Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MSComm
Message
From
21/03/2000 07:49:56
 
 
General information
Forum:
Visual Basic
Category:
ActiveX controls
Title:
Re: MSComm
Miscellaneous
Thread ID:
00348056
Message ID:
00348255
Views:
21
Thanks for the reply Joe, but I need to put some code in the OnComm() event generated by the MSComm object. I'm currently looking at the With Events keyword which seem to be what I'm looking for to hook the OnComm() event to a custom event but I wonder if it will work if I have multiples COM server running on the same machine and each server create an instance of MSComm (the machine have multiple modems).
>Couldn't you use the CreateObject command? I use it in a module to get a dynamic control that is different by year. Although I do interact with a form it could have just as well been sent to any destination. I do not even add a reference to this comm control in my project. (Notice I do not define it as an object)
>
>Public Function DisplayReturn(strReturn As String) As Integer
>    Dim objReturnInfo, strTaxYear As String, intStateLoop As Integer
>    Set objReturnInfo = Nothing
>    On Error Resume Next ' I dont care what the error is
>    Set objReturnInfo = CreateObject("ReturnInfo.ReturnInfo." & GetReturnYear(strReturn))
>    On Error GoTo 0 ' reset the error handler
>
>    ' If we can't load the ReturnInfo control, we can't get info from the return
>    If objReturnInfo Is Nothing Then ' We had some error probably no control on local machine
>        MsgBox "An error occured loading the" & GetReturnYear(strReturn) & _
>               " ReturnInfo control.  Which is needed to display desired information"
>        Exit Function
>    End If
>
>    If objReturnInfo.LoadReturn(strReturn, RI_RETURN) = 0 Then
>        frmMain.lstDatContents.Clear
>        frmMain.lstDatContents.AddItem "Return : " & Right(strReturn, 12)
>        frmMain.lstDatContents.AddItem "Office Number : " & Trim(objReturnInfo.GetStrInfo("OFFICE_NUM")) 'Added for audit
>        frmMain.lstDatContents.AddItem "Tax Year of Return : " & objReturnInfo.GetStrInfo("TAX_YEAR")
>        frmMain.lstDatContents.AddItem "----------------------------"
>        frmMain.lstDatContents.AddItem "Receipt Number : " & objReturnInfo.GetStrInfo("RCPT_DCN")
>
>snip snip ...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform