Hab das ganze nochmal laut "PerlEz.h" vervollständig, 2 Funktionen sind wohl
nicht nutzbar, haben undifinierte Anzahl Parameter, das wird so von PB nicht
unterstützt, ich denke mal die sind nicht wichtig.
Hier die "PerlEz_Include.pbi"
Code: Alles auswählen
Enumeration
#plezNoError ; success
#plezMoreSpace ; more space need To Return result
#plezError ; returned error string in buffer
#plezErrorMoreSpace ; more space need To Return error message
#plezErrorBadFormat ; format string is invalid
#plezException ; function call caused an exception
#plezInvalidHandle ; hHandle was invalid
#plezCallbackAlreadySet ; second call To PerlEzSetMagicFunction fails
#plezInvalidParams ; invalid parameter was passed To a routine
#plezOutOfMemory ; cannot allocate more memory
EndEnumeration
Import "PerlEz.lib"
PerlEzCreate(lpFileName.s = "", lpOptions.s = "") As "_PerlEzCreate@8"
PerlEzCreateOpt(lpFileName.s, lpOptions.s, lpScriptOpts.s) As "_PerlEzCreateOpt@12"
PerlEzDelete(hHandle.l) As "_PerlEzDelete@4"
PerlEzEvalString(hHandle.l, lpString.s, lpBuffer.s, dwBufSize.l) As "_PerlEzEvalString@16"
PerlEzCall1(hHandle.l, lpFunction.s, lpBuffer.s, dwBufSize.l, lpFormat.s, *lpVoid) As "_PerlEzCall1@24"
PerlEzCall2(hHandle.l, lpFunction.s, lpBuffer.s, dwBufSize.l, lpFormat.s, *lpVoid, *lpVoid2) As "_PerlEzCall2@28"
PerlEzCall4(hHandle.l, lpFunction.s, lpBuffer.s, dwBufSize.l, lpFormat.s, *lpVoid, *lpVoid2, *lpVoid3, *lpVoid4) As "_PerlEzCall4@36"
PerlEzCall8(hHandle.l, lpFunction.s, lpBuffer.s, dwBufSize.l, lpFormat.s, *lpVoid, *lpVoid2, *lpVoid3, *lpVoid4, *lpVoid5, *lpVoid6, *lpVoid7, *lpVoid8) As "_PerlEzCall8@52"
;PerlEzCall() As "_PerlEzCall" ; diese Art der variablen Parameter wird nicht unterstützt in PB
;PerlEzCallContext() As "_PerlEzCallContext"; diese Art der variablen Parameter wird nicht unterstützt in PB
PerlEzSetMagicScalarFunctions(hHandle.l, *lpfFetch, *lpfStore) As "_PerlEzSetMagicScalarFunctions@12"
PerlEzSetMagicScalarName(hHandle.l, pVariableName.s) As "_PerlEzSetMagicScalarName@8"
EndImport
Hier die angepaßte "test.pb"
Code: Alles auswählen
XIncludeFile "PerlEz_Include.pbi"
plHandle.l = PerlEzCreate("test.pl")
buffer.s = Space(1024)
Debug PerlEzCall4(plHandle, "stringfield", buffer, 1024, "sssi", @"hallo ich bin der text", @"2", @"ich", @dummy.l)
Debug buffer
PerlEzDelete(plHandle)
Nochmal die "test.pl"
Code: Alles auswählen
#!
sub stringfield { return 0 || (split(("$_[2]"||" "), $_[0]))[$_[1] - 1] if($_[1]); }
Hier der komplette Download, incl. der DLLs, der Headerdatei mit
Funktionsbeschreibung (ist sehr ausführlich), sowie den eben geposteten
Sourcen.
http://ts-soft.eu/dl/perlez.zip
@Nero
Wäre nett wenn Du noch ein paar Beispiele, bzw. auch wiederverwendbar
Funktionen posten könntest. Für einen Nicht-Perler ist das zu schwierig
