dynamic dll import (with classmate)
Posted: Thu Apr 12, 2018 10:24 am
Hi all,
I think I have found a solution:
Not the most elegant way but shows an approach.
Regards,
Stefan
I think I have found a solution:
Code: Select all
VAR dll := System.Reflection.Assembly.LoadFile(sDll)
FOREACH t AS System.Type IN dll:GetExportedTypes()
IF t:ToString():EndsWith("Functions") //should start with name of dll ( -> check)
FOREACH m AS System.Reflection.MethodInfo IN t:GetMethods()
IF m:Name:ToUpper() == "_DLLTYPE"
VAR n := (INT)m:Invoke(NULL, NULL)
....
ENDIF
NEXT
ENDIF
NEXT
Regards,
Stefan