32bit - 64bit interprocess communication
Asked Answered
M

2

7

I am tasked with implementing an xml editor based on Win32 as a frontend process, while the business logic will be handled via a 64bit process. In addition the communication between the two processes will be done via a message bus which can only transmit messages of the form wchar_t * . (Yes it is so bad).

Assuming you have only C++ 03 in your hands, no external library support e.g. Boost what would be the best design for this task? The use case is that the user simply edits some .xml files.

I was thinking having a function pointer table in the business logic module which handles the different messages and then returns back to "listening" to events.

Side question is there any "easy" way to serialize an object as a string?

Thanks a lot.

Edit:

Boost is now allowed. Should I go with ASIO or MPI? I guess the first one right?

Mraz answered 8/12, 2011 at 16:15 Comment(6)
Have you considered sending XML back and forth? :)Joost
@Joost Yes, but the UI must be stupid. That means that is should have as little "logic" inside as possible. +1 for coded smiley :)Mraz
it's not too that hard writing a bunch of serialization functions operating on std::istream and std::ostream. That way they will work for strings and it's future-proof as well. What we did here was taking a good look at boost's serialization and then write our own simplified version of it. Regarding the 32/64 bit: it's not much of a problem, just pick a convention for what you're going to use to transfer sizes of objects etc and stick to it (eg number of chracters in a string). We opted for 64bit int.Trace
@FailedDev: With my browser's fonts the non-proportional-font smileys look much better than the proportional-font ones, which is why I started to do this. Back then, however, code didn't have any background color on SO, but when they introduced that, I had already hundreds, if not thousands, of such comments. So after hesitating for a moment I decided to not to confuse my muscle memory by trying to unlearn this. (Nowadays I keep catching myself trying to do that on twitter and other places...)Joost
If you're on win32, can you use DCOM?Beniamino
@Beniamino DCOM is forbidden. Boost was also forbidden until I convinced them to use ASIOMraz
M
2

Establish a socket connection between the processes and send text messages back and forth.

For socket connections Boost.Asio is a good option, for serialization Boost.Serialization with a text archive. Although Boost.Serialization is hard to debug.

Master answered 9/12, 2011 at 16:23 Comment(0)
M
2

Establish a socket connection between the processes and send text messages back and forth.

For socket connections Boost.Asio is a good option, for serialization Boost.Serialization with a text archive. Although Boost.Serialization is hard to debug.

Master answered 9/12, 2011 at 16:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.