Hi,
Przemysław Czerpak wrote:
On Wed, 06 Jan 2010, Lorenzo Fiorini wrote:
It's only important that the functions you want to execute are
linked with server code or where loaded dynamically. you can
even make sth like:
netio_procexec( "HB_HRBLOAD", hb_memoread( "mycode.hrb" ) )
BTW a small homework ;-) Test for HVM knowledge.
Find a method to register dynamically in HVM such function from
client side using NETIO server which is linked only with default
core functions without any custom extensions.
What does it mean "with default core functions"? Can I include
HB_HRBLOAD()? Or this should be done without uncommenting REQUEST
__HB_EXTERN__ in netiosrv.prg?
If linking of HB_HRBLOAD() is allowed, I propose solution:
homework2.prg (any functions to be registered):
FUNC Hello()
RETURN "Hello, World! :)"
homework1.prg (registrator module):
STATIC s_hHrb
INIT PROC LoadHello()
#pragma __streaminclude "homework2.hrb"|s_hHrb := HB_HRBLOAD(%s)
RETURN
homework.prg (test module):
PROC main()
? netio_connect()
? NETIO_PROCEXISTS("HB_HRBLOAD")
? NETIO_PROCEXISTS("HELLO")
? NETIO_PROCEXECW("HB_HRBLOAD", HB_MEMOREAD("homework2.prg"))
? NETIO_PROCEXISTS("HELLO")
? NETIO_FUNCEXEC("HELLO")
RETURN
Unfortunately test code prints:
.T.
.T.
.F.
and application hangs up. I can not force HB_HRBLOAD() to work on server
side, though:
? NETIO_FUNCEXEC("STR", 5.1, 7, 2)
prints the expected result.
Regards,
Mindaugas
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour