Page 1 of 1
Posted: Mon Mar 03, 2003 7:58 pm
by BackupUser
Restored from previous forum. Originally posted by Num3.
Can anyone gimme a help on this one?
;DLL Procedure
ProcedureDLL settext(a.s)
ProcedureReturn a+" OK"
EndProcedure
;Function Call
If OpenLibrary(0,"add.dll")
*a.s="Zé"
MessageRequester("Result",Str(CallFunction(0,"setstext",*a)),0)
EndIf
Result is alway "0"
--
Kind Regards
Rui Carvalho
Old programmers never die... They branch into a subroutine...
Posted: Mon Mar 03, 2003 8:05 pm
by BackupUser
Restored from previous forum. Originally posted by Manolo.
Name of function:
settext(a.s)
setstext
is diferent.
Manolo
Posted: Mon Mar 03, 2003 8:20 pm
by BackupUser
Restored from previous forum. Originally posted by Num3.
I've seen it was from retyping....
The function name is correct, just misspelled here
You see a DLL only accepts pointers in, but i can't seem to get the text out of the pointer it returns inside the DLL
Here's another example:
;DLL CODE
ProcedureDLL add(a,b)
ProcedureReturn (a+b)
EndProcedure
ProcedureDLL settext(a.s)
ProcedureReturn a+"OK"
EndProcedure
; Function Calling
If OpenLibrary(0,"add.dll")
*a.s="Peter Pan"
MessageRequester("Result",Str(CallFunction(0,"add",5,6)),0)
;Result is eleven
MessageRequester("Result",Str(CallFunction(0,"settext",*a)),0)
;Result is 1 ???
EndIf
--
Kind Regards
Rui Carvalho
Old programmers never die... They branch into a subroutine...
Posted: Mon Mar 03, 2003 11:35 pm
by BackupUser
Restored from previous forum. Originally posted by VPureBasic.
Hi Num3.,
Originally posted by Num3
I've seen it was from retyping....
The function name is correct, just misspelled here
You see a DLL only accepts pointers in, but i can't seem to get the text out of the pointer it returns inside the DLL
Here's another example:
;DLL CODE
ProcedureDLL add(a,b)
ProcedureReturn (a+b)
EndProcedure
ProcedureDLL settext(a.s)
ProcedureReturn a+"OK"
EndProcedure
; Function Calling
If OpenLibrary(0,"add.dll")
*a.s="Peter Pan"
MessageRequester("Result",Str(CallFunction(0,"add",5,6)),0)
;Result is eleven
MessageRequester("Result",Str(CallFunction(0,"settext",*a)),0)
;Result is 1 ???
EndIf
--
Kind Regards
Rui Carvalho
Old programmers never die... They branch into a subroutine...
First set your procedure to "PROCEDUREDLL.s"
Second Read the return loke this:
Sentence.s = PeekS( CallFunction( 0, "settext","This example works.." )
Roger
Posted: Tue Mar 04, 2003 9:04 am
by BackupUser
Restored from previous forum. Originally posted by Num3.
Sh*t .... of course!!!!
That's another undocumented feature... Didn't know abou PROCEDUREDLL.s
--
Kind Regards
Rui Carvalho
Old programmers never die... They branch into a subroutine...