prototype's...with numeric values is working fine...but with string I not know how...All function execute and working fine
returning correct values...only have problem with return string.
My DLL is VegaEVAL.DLL and this is code for execute functions of DLL:
The message displayed in debug is: Invalid memory access. (write error at address xxxxx)
Code: Select all
Procedure UseVegaEval(filename$)
xDLL = OpenLibrary(#PB_Any, filename$)
If Not xDLL
MessageRequester("Dll not can be load","Error loading VEGAEVAL.DLL",0)
EndIf
ProcedureReturn xDLL
EndProcedure
DLLX=UseVegaEval("VEGAEVAL.DLL")
Prototype.l ProtoSetMaxVariables(maxvar.l)
SetMaxVariables.ProtoSetMaxVariables=GetFunction(DLLX,"SetMaxVariables")
Prototype.l ProtoSetMaxLines(maxlines.l)
SetMaxLines.ProtoSetMaxLines=GetFunction(DLLX,"SetMaxLines")
Prototype.l ProtoSetValue(var.s, value.d, mode.l)
SetValue.ProtoSetValue=GetFunction(DLLX,"SetValue")
Prototype.d ProtoGetValue(var.s)
GetValue.ProtoGetValue=GetFunction(DLLX,"GetValue")
Prototype.l ProtoSetTextValue(var.s, value.s, mode.l)
SetTextValue.ProtoSetTextValue=GetFunction(DLLX,"SetTextValue")
Prototype.l ProtoExeBasic(code.s, handle.l,mode.l)
ExeBasic.ProtoExeBasic=GetFunction(DLLX,"ExeBasic")
Prototype.i ProtoGetTextValue(var.s)
GetTextValue.ProtoGetTextValue=GetFunction(DLLX, "GetTextValue")
SetMaxVariables (10000)
SetMaxLines (10000)
SetValue ("A#", 100.25, 1)
SetValue ("B#", 1.50, 1)
SetValue ("C#", 999.99, 1)
ExeBasic ("C#=((A#+B#+C#)*18.14)/2",0,1)
C.D=GetValue("C#")
MessageRequester("Result",StrD(C.D),0)
SetTextValue("VAR1$","Israel Vega Alvarez",1)
ExeBasic ("VAR2$=VAR1$",0,1)
varx.s="VAR2$"
;This is problem for execute. I was try with 2 ways
;VAR2X$=PeekS(CallFunction(DLLX,"GetTextValue", @varx.s))
VAR2X$=PeekS(GetTextValue(VARX))
MessageRequester("Value of Variable: ",VAR2X$,0)
result.d=GetValue("C#")
MessageRequester("",StrD(RESULT.d),0)
CloseLibrary(DLLX)