Xojo Runtime Error Loading DLL's

1 out of 3 times (sometimes 3 out of 3, but on average) Xojo will not start an application loading DLLS and I get:

Runtime Error
Press OK to Continue
Press Cancel to Quit.

Please report what caused this error along with the information below.

Failure Condition: 0
Failed to load library user32.dll
Invalid access to memory location.
jR•M (this line changes at every failure)

Can’t report what is not known why the failure occurred. It happens with all sorts of DLL’S (have tried like 50).

Have tried the same declares from VB6, C++, Lua, Lazarus, and a few other languages… They seem to load perfectly and invoke the export functions. So I’m assuming this to be a Xojo bug?

Xojo 2013r4.1

Upon investigation of the system memory, the DLLs are not being released when they do work and the application is ‘destroyed.’ Is there a work around where I can obtain the memory handle to the loadlibrary function that’s called from the Xojo framework when a library is declared, so I can implement FreeLibrary api myself during app.close? This is indeed the problem as, once the application quits, the declared DLL cannot be moved, renamed, or deleted as it says it’s still in use by applicationname.exe (even though it no longer exists in the processes viewer). If I flush the memory using the Microsoft flush toolkit, I can again run the application, the dll is loaded perfectly, and not released again in memory on quit… which prompts the error on consecutive run attempts.

Do you have declares to user32.dll in code?

Any dll does it, less so Windows specific dlls (like user32.dll that was just used for example. ) almost every time the problem arises with custom made dlls (no other language shows any problems loading or releasing them so it’s not my coding)…the problem happens less with RS2012r2.1 than Xojo2013r4.1. When the problem does arise in 2012 the loader.cpp line is 167. In Xojo line 170. The Xojo applications are not releasing the memory after quiting (it can be seen by the memory pool differentials as well… The amount available does not reflect the actual amount of totaling what is actively being used) :-/ i can upload an example dll that loads perfectly every time the first time, and each time after will fail until xojo releases the library if it helps.

Hello all
Same issue
but, it cannot be my code or declaration (as i read in another conversation) sinces it happens to me when I lauNch XOJO, not when running my app. But, now (after the issue) RUN takes a lot of time and pops the windows to wait, hide or cancel.
Is it a good idea to re-install Xojo?
thanks for your help