Midas.dll error loading midas.dll

2020-02-14 03:33发布

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

2条回答
萌系小妹纸
2楼-- · 2020-02-14 04:16

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.

查看更多
祖国的老花朵
3楼-- · 2020-02-14 04:18

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.

查看更多
登录 后发表回答