Link to home
Start Free TrialLog in
Avatar of jack niekerk
jack niekerkFlag for Netherlands

asked on

VB6 ERROR NUMBER 97 AT RUNTIME

When I end  my VB6 program I get the following error code , status description

run-time error '97'
Can not call friend function on objects which is not an instance of defining class
Its a normal VB6 program, the only thing extra is I have a activex (.ocx)  wich runs and calls in background the comport for input and sending data to a scanner
Avatar of Hitesh Manglani
Hitesh Manglani
Flag of India image

Avatar of jack niekerk

ASKER

ok, I did read this, the explanation does make sence since this only happens when I have my Activex module wich does call the Mscomm routines in a program.  The only thing wich is new to me in de support message from microsoft is the statement:  ' friend function'   what does this mean?

Thanks en regards
Jack
ASKER CERTIFIED SOLUTION
Avatar of Hitesh Manglani
Hitesh Manglani
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks I will take a further look in thia matter, and see if I can solve my problem. for mean while I do this.

In my activeX I use a lot like:
   Public Received$, Send$, ErIn$, START%, EIND%, ZERO%, LANG%, WEEG1DEC%, WEEGDEC%
   Public Led1 As Boolean
   Public Led2 As Boolean
   Public Led3 As Boolean
   Public NETTO As Boolean
Then I can say in any other program if name of Activex is EWB
"if  EWB.Led3=true then ...."

and also this way in ActiveX:
Dim c_Speed As Long
Dim c_PortNum As Long
Dim c_Bits As Long

Then I can say in any other program if name of Activex is EWB
EWB.Speed = SpeedToUse
EWB.PortNum=  ComPortToUse

Could it be that eiher the Public way causes th error or the other way of sharing callin varivables?


Thanks, regards Jack