Questions about DLLs used by scripts.

I'm thinking of writing a script that utilises a DLL file to handle a few things. I ask:

-Is there any limitation in what language it must be written? Can I use a dll file that uses Microsoft .NET Framework?

-How do I call the functions that are in the DLL?

-Since the DLL may open an external UI in some instances (for example, opening a file picker), is there a need to pause the game (ie. the engine waits until the Dll's function finishes)?

-If there's a need, how do I refresh a scene when the DLL finishes it's work (eg. A save/load screen)?
- As far as I know, the dll can be written using any language.

- You call dll functions by creating a Ruby object of class WIN32API that is bound to a specific function. So if you have ten dll functions, then you'll need ten Ruby objects. Check out the WIN32API class documentation for more details. This link http://ruby-doc.com/docs/ProgrammingRuby/html/lib_windows.html has a good explanation but realize it's written for Ruby 1.6 so some of it may be outdated.

- When you call the function, Ruby should wait for a return value from the function. So depending on when that happens will determine whether you need to pause the game. Also keep in mind that RGSS needs Graphics.update to be called regularly or it will consider the game to have frozen and cause it to exit.

- Not entirely sure what you mean by this, but once the dll finishes it should be fairly simple for your Ruby code to continue.
I'm not 100% sure, but I remember there being some sort of issue with .NET DLLs. All the ones I've used and made were C++ only, and even then since ruby and C++ are different languages, sometimes getting the data to the DLL is sub-optimal.
It's possible but it's far easier to write it in a non .NET language that doesn't have to be C++. It's usually preferable to use Win32API or DL (VX Ace only) anyway. Except when that isn't possible (opening a file picker dialog window is though) or too slow (RGSS bitmap data manipulation).

Original thread: https://forums.rpgmakerweb.com/threads/questions-about-dlls-used-by-scripts.46011/