1
votes

I have a COM object, originally compiled under Delphi 2007, 32-bit. Now I have ported to Delphi XE3 using 64-bit compiler. It compiles successfully with a new 64-bit DLL but I just can't get it registered.

I am using the Admin to register the DLL, it works fine for 32-bit DLL but not for 64-bit.

It keeps saying 'Invalid Access to Memory Locations'

Any hints here?

PS: the command i use is simply %systemroot%\System32\regsvr32.exe test.dll.

When registered in Windows 7 64-bit, it shows 'Invalid Access to Memory Locations'; when registered in Windows 8 64-bit, it shows 'A dynamic link library initialisation routine failed'.

1
If this is your first attempt to run this code then you should expect pointer truncation bugs. Add madExcept or similar and get some debug information. If you can build the code into something easy to debug then that might help too. - David Heffernan
Isn't there a regsvr64.exe that you need to use? - Nick Hodges
@NickHodges - regsvr32 does the trick. No idea why it doesn't have 64 in the name for 64-bit systems. I'm using it for a deskband DLL which has both 64 and 32-bit versions, and it's the same command for the 32 or 64-bit. - Chris Thornton
It's called regsvr32 for the same reason comctl32 is, system32 is, user32 is and so on. - David Heffernan
This won't help much, but I took my 32-bit PowerPoint add-in, recompiled with the 64-bit compiler (and latest Add-in Express version) and it worked just fine. You need to look to the interface definitions to make sure you are matching properly on the new platform. - mj2008

1 Answers

0
votes

Yes, i found the cause. In initialization section of one of the unit, it still uses third party 32-bit floating operations. After I remove the code, it successfully registers the DLL.

On win7, the errormessage is confusing, but on win8, it says "'A dynamic link library initialisation routine failed', which gives a clearer cause.