Communicating between Mac/WINE/Windows processes

Got an interesting challenge here.

I have created an application for Windows that I need to port to Mac. The core functionality of this application is provided by a Windows-only Active-X control, which is not going to get a Mac port anytime soon.

I considered wrapping the Windows application in a WINE wrapper, but I really want to have a native Mac interface for this.

So I came up with this crazy idea of building a companion application that hosts the Active-X control that I can wrap within WINE, and then building a separate application for the UI.

This would be my new framework for both Windows and Mac. The “engine” of the program will be a Windows application on both OS’s (in WINE on Mac), and then there’s a smaller, lightweight OS-specific application that interfaces with the engine.

The problem now becomes how to interface with that engine application. On Windows systems it would be easy enough, I can just use an IPCSocket. But on Mac, an IPCSocket will not communicate with a WINE-wrapped Windows IPCSocket (I tried).

Ideally, I would like to use the same communications method on both platforms, and in a perfect world I wouldn’t have to develop a low-level comm protocol for these two applications to share text data back-and-forth.

Any ideas?

What about a TCPSocket?

Hi Neil, thanks for your reply. The thought I had about TCPSockets are that the open port may be blocked by the OS’s firewall and/or flagged by aggressive antimalware software without a lot of other configuration which the user may not even have access to.

That’s true.

Depending on your needs you might be able to write a text file to disk. That is a little hackish though.

Generally a firewall will not block local TCP sockets.

I agree, Really crazy :slight_smile:
But as far as I have seen in project I did using TCP-IP sockets, it works fine.

I’ve used both TCP sockets and UDP (for multicast) for intra-LAN communications, plus for between two programs on the same machine used either NSNotificationMBS or WinNotificationMBS depending on the OS. But I don’t know that those notification classes work ACROSS platforms on the same machine.

Thanks for the replies everyone! Just had a thought that I’ll need to try this weekend. I wonder if I force the IPCSocket.Path to a filename that’s shared on the virtual filesystem in WINE if IPCSockets between the two OS’es will communicate with each other. This could overcome the IPCSocket failure I experienced in my early tests.

If that fails I will give TCP sockets a go.

Thanks again!