Problem solved. From what I understood so far:
- Lua 5.1 is advertised to be 32 bit while DVR is 64 bit.
- My Lua DLL is 64 bit too so it needs a 64 bit runtime environment.
- DVR docs tell you that you need to install Lua 5.1 but this doesn't fix the problem because 5.1 is 32 bit.
- Examining the dependencies of the DLLs made things a bit clearer.
I copied the "Lua.5.1.dll" from the DVR program directory into the same directory as my Lua DLL and renamed it to "Lua51.dll" as shown in the dependencies. Looks like BMD baked their own Lua51 x64 DLL.
Now everything runs just fine.
Maybe I am missing something here but that's the way it works for me. Just started to learn this Lua scripting stuff...