MFC DLL Distribution Question
-
Hello everyone, I have a question about how to distribute the MFC DLLs with an application. I have read elsewhere how to distribute the MFC DLLs and which ones I need using Dependency Walker. I have code that properly installs the DLLs, which I believe are for all Windows versions, but I am unsure whether this is the best way to do it under Windows 2000 and XP. Instead of installing the DLLs into the system folder etc., should I put the DLLs in the application's folder along with a .local file? Or should I go ahead and install them into the system as usual for Win95/98/Me etc? Also, I have Visual C++ Professional, and could statically link to the DLLs. Is there any disadvantage to statically linking to the DLLs, instead of dynamically and having to install the MFC DLLs? Are there times when I should dynamically link, and times I should statically link? (assuming I am running VC++ professional)?
-
Hello everyone, I have a question about how to distribute the MFC DLLs with an application. I have read elsewhere how to distribute the MFC DLLs and which ones I need using Dependency Walker. I have code that properly installs the DLLs, which I believe are for all Windows versions, but I am unsure whether this is the best way to do it under Windows 2000 and XP. Instead of installing the DLLs into the system folder etc., should I put the DLLs in the application's folder along with a .local file? Or should I go ahead and install them into the system as usual for Win95/98/Me etc? Also, I have Visual C++ Professional, and could statically link to the DLLs. Is there any disadvantage to statically linking to the DLLs, instead of dynamically and having to install the MFC DLLs? Are there times when I should dynamically link, and times I should statically link? (assuming I am running VC++ professional)?
At some point, redistributing the MFC DLLs is going to cause you and your customers problems. Putting them in the system directory is a crash waiting to happen. How do you know someone else won't come along, and replace your DLLs with another version? If you absolutely have to redistribute them, then put them in the app's directory. Otherwise, you should prepare yourself for customer reports like "I just installed your app, and now this other app doesn't work." A far better approach is to statically link. This way, you know your app will work, regardless of what's on your customer's machine. And you also know you won't be impacting other apps. You're trading program size for program stability. Your app will exist long after you have stopped working on it. Do you really want somebody to install your app 10 years from now, and step on some DLLs that another program relies on? HPS HwndSpy - GUI developer's aid to visually locate and inspect windows. For the month of August only, use coupon code CP-81239 for 30% off.
-
At some point, redistributing the MFC DLLs is going to cause you and your customers problems. Putting them in the system directory is a crash waiting to happen. How do you know someone else won't come along, and replace your DLLs with another version? If you absolutely have to redistribute them, then put them in the app's directory. Otherwise, you should prepare yourself for customer reports like "I just installed your app, and now this other app doesn't work." A far better approach is to statically link. This way, you know your app will work, regardless of what's on your customer's machine. And you also know you won't be impacting other apps. You're trading program size for program stability. Your app will exist long after you have stopped working on it. Do you really want somebody to install your app 10 years from now, and step on some DLLs that another program relies on? HPS HwndSpy - GUI developer's aid to visually locate and inspect windows. For the month of August only, use coupon code CP-81239 for 30% off.
HPSI wrote: At some point, redistributing the MFC DLLs is going to cause you and your customers problems. Putting them in the system directory is a crash waiting to happen. How do you know someone else won't come along, and replace your DLLs with another version? If you absolutely have to redistribute them, then put them in the app's directory. Otherwise, you should prepare yourself for customer reports like "I just installed your app, and now this other app doesn't work." Agreed!