PDA

View Full Version : Registering a DLL



minestrone
6th May 2015, 14:10
Firstly I know this is a laughably easy thing to do for a Microsoft type but I'm struggling.

It is a 64 bit DLL and I'm on a 64 windows 8.1.

I dropped it in to SysWOW64 which I have learned from foogling might be the location for this(?), from my brief Microsoft programming experience you used to register it at the command line with regsvr32 but that obviously seems to be a 32 bit solution(?).

I'm not sure if I can check on the command if the dl is registered as my (java jni) application is not seeing it.

Cheers

vwdan
6th May 2015, 14:16
Welcome to the confusing world of Windows on Windows.

C:\Windows\System32 is the 64-bit location on 64-bit machines. Everything in here is 64-bit, including things like regsvr32
C:\Windows\SysWOW64 is the 32-bit compatibility location on 64-bit machines

So, if your application is 64-bit you need to use C:\Windows\System32, if it's 32-bit you need to use C:\Windows\SysWOW64

VectraMan
6th May 2015, 14:24
Assuming it's a COM DLL. There's no such thing as "registering a DLL" strictly speaking.

Where you put the DLL doesn't matter. Well it didn't used to, but I haven't done such things in Windows 8. You need to regsvr32 it in an elevated command prompt.

minestrone
6th May 2015, 14:53
Cheers all, got that working.

Slotted in the 64 bit dll into the system32 directory. Pretty counter intuitive.

My first job out of uni 16 years ago was writing install scripts for a windows application, much of it was messing around with DLLs. I can see it has not got any better.

minestrone
6th May 2015, 15:55
Christ, the DLL can crash my JVM if the configuration file needed by the DLL is not found.

I've always been a fan of fail fast programming but this takes it to the extreme.