Jose Luis he probado el código en un mismo PRG. Poniendo la funcion main al principio y va perfectamente :-)

De hecho yo lo uso en mis clases y no me falla

#include "hbclass.ch"

FUNCTION MAIN()

  LOCAL o

  o := MyOtherClass():New()

  ? o:MyMethod()  // --> 'Bye'

RETURN NIL

CLASS MyClass
  METHOD MyMethod() INLINE 'Bye'
  METHOD New() INLINE Self
ENDCLASS


CLASS MyOtherClass FROM MyClass
  METHOD MyMethod()
ENDCLASS

#pragma BEGINDUMP
#include "hbapi.h"

HB_FUNC_STATIC( MYOTHERCLASS_MYMETHOD )
{
  hb_retc("Hello");
}

#pragma ENDDUMP




José Luis Capel - escribió:
Hi all,

This piece of code (three separate prg's):

// one.prg

CLASS MyClass
   METHOD MyMethod() INLINE 'Bye'
   METHOD New() INLINE Self
ENDCLASS

// Two.Prg

CLASS MyOtherClass FROM MyClass
   METHOD MyMethod()
ENDCLASS

#pragma BEGINDUMP
#include "hbapi.h"

HB_FUNC_STATIC( MYOTHERCLASS_MYMETHOD )
{
   hb_retc("Hello");
}

#pragma ENDDUMP

// Three.prg
FUNCTION MAIN()

   LOCAL o

   o := MyOtherClass():New()

   ? o:MyMethod() // --> 'Bye'

RETURN NIL

Should not it shows 'Hello' instead of 'Bye'??

I make the question in other words...

How can I 'emulate' xHarbour behavior ??

Do I have to set any flag ??

If not... how can I mix (in same prg) prg level methods of a class with C level methods of same class ??

Many thanks for your help.
José Luis Capel







_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to