I'm at a mental brick wall with this..... if I have a SWIG generated
DLL for Ruby to access my C++ code, and I have a simple MFC exe.  Say
my DLL contains a method to set or get a global variable, how can I
get my MFC app to read that value? Surely the MFC app has a different
heap to Ruby and they can never share data?

I want to make some progress with C++ and Ruby using SWIG but I can't
quite see how it comes together?

As the most basic example I'd like to be able to create 2 MFC controls
on screen, one which is an edit box which can take strings to execute
as a line within a Ruby script.  One command would set a variable in
the SWIG dll so that a 2nd MFC control can show the contents of that
variable.

Basically using Ruby within an editbox in ab MFC app to directly
affect the member variables of other screen controls within the same
app.

I apologise for my ignorance but it's all a bit new to me and some
guidance in this matter would be incredibly useful.

Many thanks

Chris.