What if you registered the DLL through your code? Calling DLLRegisterServer (I think it is) from the DLL.
js code:
function RegisterDLL(DLLPATH) {
var iLib = Interop.Call('kernel32', 'LoadLibraryW', DLLPATH);
if (iLib) {
var iProcAddr = Interop.Call('kernel32', 'GetProcAddress', iLib, 'DllRegisterServer');
if (iProcAddr) {
if (Interop.Call('user32', 'CallWindowProcW', iProcAddr, 0, 0, 0, 0) === 0 /* ERROR_SUCCESS */) {
// DLL has been registered
}
else {
// DLL failed to register...
var buffer = Interop.Allocate(1024);
Interop.Call('kernel32', 'FormatMessageW', 0x1000, 0, Interop.GetLastError(), 0, buffer, 1024, 0);
Debug.Trace(buffer.ReadString(0));
buffer.Size = 0;
}
}
else
Debug.Trace('Could not find ProcAddress for DllRegisterServer');
}
else
Debug.Trace('Could not load the DLL');
Interop.Call('kernel32', 'FreeLibrary', iLib);
}