Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling "The Vampire" COMM Control

Status
Not open for further replies.

NIWANut

Programmer
May 20, 2003
25
NZ
Hi,

I used your code in thread222-1000041 but I get an error on this line

COMMData.NewDataString = S

in

Private Sub MsComm1_OnComm()
' this sub fires whenever new data has arrived at the Comm port
Dim S As String

S = MSComm1.Input

' send this new string to the COMMData class for assembly into the full string
' and possible activation of the DataArrived event.
COMMData.NewDataString = S

End Sub


The error code is 91 and description is "Object variable or with block variable not set"

I have this in my declarations

Dim WithEvents COMMData As clsCOMMDATA

I have set up a simple form with only one text box to try it out and am using a laptop to send text to my desktop running my test application. I have tested the connection by using Hyperterminal on the desktop and it displays the exact characters I send from the laptop so the serial line is working. I cannot see what the problem is here, perhaps you can see the error.

Thanks



George
 
And where have you initialized your object? i.e.
Code:
Set COMMData = New clsCOMMDATA

Until you do that, you will get error #91 when you try to use it.

 
Sorry, been too busy the last couple of weeks to check in here. Did Joe's suggestion fix your problem? Also, you have to have the COMMData class as part of your project.

RT
 
Hi Vampire and JoeAtWork,

Thanks for your suggestions that worked, just me being a little thick, perhaps the days are getting too long.

This resource is fanatastic and guys like you certainly make it what it is.

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top