Posted on 2007-09-29
Medium Priority
Last Modified: 2012-06-27
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
Question by:BIAPRO
  • 2
  • 2
LVL 13

Expert Comment

ID: 19986340

Author Comment

ID: 19986548
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
LVL 13

Accepted Solution

hiteshgoldeneye earned 1500 total points
ID: 19987144

Author Comment

ID: 19987194
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


Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question