I've downloaded a MapInfo callback program from Trey patillo which he
originally wrote for VB 5. As it it works fine in VB 6.

However, I've tried to include it into a Standard.EXE VB 6 application that
has multiple forms and an MDI form. There is a module in VB 6 that declares:

' CLASS DEFINITION FOR MAPINFO CALL BACK
 Public MyCallback As New CMyClass
' CLASS DEFINITION FOR MAPINFO CALL BACK

The Class Module code is:

Option Explicit
Public Sub SetStatusText2(ByVal Wert As String)
  'local variable to work with
  Dim Trash As String
  'Dim Wert As String
  '******************************
  MsgBox Wert
  '****************************
  
  'get the string passed by MapInfo
  Trash = Wert
  
  'Check for the "tab" character
  If InStr(Trash, Chr$(9)) > 0 Then
    Form21!lblStatBar.Caption = Left$(Trash, InStr(Trash, Chr$(9)) - 1)
  Else
    Form21!lblStatBar.Caption = ""
  End If
  
  'see if "snap" was toggled
  If InStr(Trash, "SNAP") > 0 Then _
    Form21!lblStatBar.Caption = Form21!lblStatBar.Caption + "   SNAP"

' YOU CAN ALTER THE ABOVE CODE SEGMENTS
' TO REFLECT WHAT YOUR "STATUS BAR" NEEDS
' THE ITEMS OF THE STRINGS ARE SEPARATED WITH "TAB" CHARACTERS

End Sub

The Form21 has the following statements:

Private Sub bStartMI_Click()

  'stop user from second click
  bStartMI.Enabled = False
  
  'create the MapInfo OLE Object
  Set MIDetail = CreateObject("MapInfo.Application")
  
  'tell MapInfo the CallBack Class Object
HERE COMES THE ERROR MESSAGE

  MIDetail.SetCallBack MyCallback

HERE COMES THE ERROR MESSAGE

Run Time Error 98: A property or methof call cannot include a reference to a
private object, either as an argument or as a property.


If I simply send a string to the Class module eg, through
  Set MyCallback = New CMyClass
  MyCallback.SetStatusText2 ("Hund") 

and skip the MapInfo SetCallback Command I have no problem whatsoever.

Can somebody give me an idea of what my mistake may be?

Harald Sch�lzel
Economist Civil Engineer
c/o SOPAC South Pacific Applied Geoscience Commission
Private Mail Bag
Suva, Fiji
Tel: Business (679) 381 377 private (679) 386 236
Fax: (679) 370 040
Mailto:[EMAIL PROTECTED]
URL: http://www.sopac.org.fj/wru
Mirror URL: http://www.sidsnet.org/pacific/sopac/wru

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to