Verfasst: 15.02.2007 02:59
@Mischa
Klasse, das mit der Runtime DLL ist eine feine Sache, vielleicht
sollte man den Compiler auch so abändern, so das direkt die Sourcen genutzt
werden können, also compileren und ausführen über eine DLL?
Auf jedenfall kann ich meine Pläne, LUA zu lernen jetzt vergessen, so ist es
einfacher
Hab das Beispiel "pb_com_example.pb" mal um GetExePath ergänzt, so läuft es auch ohne Pfadanpassung.
Hab nämlich getestet ohne zu lesen
, da kam nur -1
Gruß
Thomas

sollte man den Compiler auch so abändern, so das direkt die Sourcen genutzt
werden können, also compileren und ausführen über eine DLL?
Auf jedenfall kann ich meine Pläne, LUA zu lernen jetzt vergessen, so ist es
einfacher

Hab das Beispiel "pb_com_example.pb" mal um GetExePath ergänzt, so läuft es auch ohne Pfadanpassung.
Code: Alles auswählen
;Simple example how to communicate with 'mother'- application
;Maybe its a bit useless to give only one function address to the script,
;but this is only for demonstration. Normaly you would allocate one
;memoryblock with a pointer table of all functions you want share,
;or something
;PLEASE CREATE EXECUTABLE, OR CORRECT PATH TO DCF
Procedure.s GetExePath()
Protected Result.s
If UCase(GetPathPart(ProgramFilename())) = UCase(#PB_Compiler_Home + "Compilers\")
Result = GetCurrentDirectory()
Else
Result = GetPathPart(ProgramFilename())
EndIf
If Right(Result, 1) <> "\" : Result + "\" : EndIf
ProcedureReturn Result
EndProcedure
Global answer.s
Procedure MyFunction(text.s)
MessageRequester("Comes in from D-Lib..",text)
answer="Oh, hello D-Lib. Nice to meet you."
ProcedureReturn @answer
EndProcedure
OpenLibrary(0,"DRun.dll")
Result = CallFunction(0,"StartDLibScript", GetExePath() + "dlib_com_part.dcf",@MyFunction())
MessageRequester("DLib Return value",Str(Result))


Gruß
Thomas