Posted on 2007-09-29
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
    LVL 13

    Expert Comment


    Author Comment

    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


    Author Comment

    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

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now