Midas.dll error loading midas.dll
Asked Answered
B

2

9

I have a problem when I try my app on an other computer without Delphi.

If I put midas.dll in the same folder / directory on System32 I always get error message Error loading midas.dll, but if I put midas.dll on the desktop then the error message does not appear and the application runs normally.

How to handle midas.dll so I can place it in the same folder?

enter image description here

enter image description here

Beyrouth answered 16/9, 2014 at 20:7 Comment(8)
That's more than weird. Having the library in the same folder as your executable should be enough (this article confirms that by "If you need to distribute this application you may also need to deploy this library to a location where the application can find it." which means that your app. is not searching for midas.dll in some predefined path, but is most probably using the common DLL search mechanism).Kalmick
but what if I put midas.dll at C: \ Windows \ System32 as the default Delphi applications can did not detect the presence of midas.dll? why it should be put in place that is not supposed to (Desktop)? I've tried on the previous OS: XP, Seven & Linux BT5-R3 all goes as in the picture?!?! ...Beyrouth
Don't ever write to system32Tippett
Just for curiosity : Why are you using the midas.dll and not the MidasLib unit?Washwoman
Now I don't know how are you loading the midas.dll since you haven't shown any code about this but based on the pictures I suspect next posibility: On second picture I can see that your database location is on Desktop so I'm wondering if you might not be changing the working directory of your application. If you are changing it before you load dll at runtime may prevent your program from finding it as by default it first seaches for it in WorkinDirectory and then on system path. The only strange thing is that it doesen't find it even when the file is available in system path.Clinton
TClientDataSet that calls midas.dll to process xml and otherBeyrouth
I think @manlio is correct and comments about how you are loading Midas.Dll are maybe missing the point; the Delphi r/time code which loads Midas.Dll primarily uses its registration entry in the Registry in order to locate it. A couple of details missing from your q, though: Are you running on Windows 64-bit or 32-bit, and which of those is your project targeting? (or does your Delphi pre-date 64-bit compilation?) Oh, and as usual, DavidH is 100% correct - if you feel the need to write to System32, most likely you are doing something wrong.Derogative
ok thx all, now all is running well. because the problem lies in this line uses ----> MidasLib;Beyrouth
C
19

From the command line type:

regsvr32 filepath\midas.dll

You should specify a full path (if another copy of midas.dll exists in the system search path, regsvr32 may choose that copy instead of the one in the current directory).

The first time midas.dll is loaded on a machine, it writes a registry entry where it is located.  After that, it always looks to that original location when it is needed.

Corporate answered 16/9, 2014 at 20:25 Comment(4)
That little beast :-)Kalmick
to install on 32 bit machine: regsvr C:\Windows\System32\midas.dll To install on 64 bit machine regsvr C:\Windows\SysWow64\midas.dll Related reference hereDiver
Here is the complete instructions: dlldownloader.com/midas-dllThrombophlebitis
I would like to add that if you are doing it on remote server via RDT you need to use Administrator account. Otherwise it might not work.Rabassa
B
16

Why Are You Here?

You made some changes in past few days, no, nothing special, and then you released your executable like always. All of a sudden someone informed you that the application no longer runs on their machine, but it displays an error message saying "Error Loading MIDAS.DLL"! So you googled it and you are here. (If this is not the case you can skip my answer)

What Has Happened?

Well, you have used one of TCustomClientDataSet descendants, probably TClientDataSet, and it needs Midas.DLL.

How can you fix this?

You have two options:

  1. Deploy Midas.DLL with your application.

    • Pros: Your executable remains smaller.

    • Cons: You need to get prepared for a war against a brutal army consisting of OS, anti viruses, installer makers, ..., and the midas itself (read OP's question again for an example!).

  2. Add the MidasLib unit to your project's uses clause.

    • Pros: if (not FMuslim) or (not IsRamadan) then you can get some coffee and enjoy it.
    • Cons: Your executable gets bigger (113,664 against 1,124,352 bytes for a just created console application in Delphi2010).

PM: You're right, this is not the right answer to OP's question. Yes, RRUZ has a comment up there, and yes, there's an older question with an accepted answer. But time has passed and Google still insists on this page. I'm pretty sure that such answer could help a noticeable portion of those 24k people who have visited this page during past 4 years.

Boughten answered 18/6, 2018 at 10:8 Comment(1)
Actually, just deploying the DLL don't help, as it need to be 'registered'. and 2) it does not work for a C++ builder application.Dismember

© 2022 - 2024 — McMap. All rights reserved.