Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MSComm
Message
From
20/03/2000 16:25:15
 
 
To
20/03/2000 15:05:24
General information
Forum:
Visual Basic
Category:
ActiveX controls
Title:
Re: MSComm
Miscellaneous
Thread ID:
00348056
Message ID:
00348116
Views:
24
>I need to use the MSComm control in my COM. Is there a way to attach some code to the OnComm event of MSComm without having to drop the control on a form?
>
>TIA


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 ...
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform