0
votes

Currently we have a legacy client/server system written in MFC(server) and Java(client). This system cant not run on Internet because of various reason. So, we are developing a small system (very few functionalities of this legacy system) in cake php etc to fullfill customer requirement.

Now, one functionality in legacy system needs in this new system. We are thinking of making a DLL of that code and then integrate it with cake php (to save time) but this DLL will not work on Linux where this new system will sit.

So, is there any way to generate a dll so that it works with php in Linux system using QT etc?

OR

we have to rewrite the whole thing? In this case, what would be the most appropriate framework to develop cross platform dll. I would prefer to use Windows to write it.

Also, can we run dll with cake php?

Thanks

2
The only way for windows DLLs to work on linux is wine. You will need to rewrite your whole code with PHP. MFC does not work on linux so Qt is a good option here.user744186
This needs more detail. The best strategy for porting this code depends entirely on what it does and what APIs it uses. As Aleksandar points out, Wine/winelib can be a good choice if your dependencies are simple (e.g. win32 calls only). If you have more complicated needs, you might consider running "real" windows on your Linux system as a VM guest, and writing some shim code to talk to your windows server from PHP over a local socket, etc... But the details matter, we can't tell you how to port code we've never seen.Andy Ross
thanks for your comments, its not over complicated functionality. As this code is a part of big MFC app, I want to reuse this code and put it in library for php stuff running on Linux. Mainly, it uses MFC's CString, list classes like CStringList etc, SQL API for ODBC connection. I hope it will give more clarity about the requirement.user2076166

2 Answers

0
votes

So, is there any way to generate a dll so that it works with php in Linux system using QT etc?

No, Linux doesn't support the DLL file format. You may want to compile a shared object file in the ELF format from your source code.

0
votes

I think, the two most prominent cross platform GUI libraries are wxWidgets and Qt.

You cannot use a Windows DLL as a part of a Linux application. That is simply not possible, because of the different object formats.

So, the only option is to rewrite or port it in some form.

A guide for porting your application might be Porting MFC applications to Linux, which uses wxWidgets.

Another one using Qt, could be MFC to Qt Migration - Walkthrough.