Joey said:
Would it be possible to declare an instance of a class locally in a
function, and then have that stay there and be able to be accessed
later by a pointer to it (from another program)?
I am working on a DLL, and I need similar behaviour to this...
No. Local instances get destroyed (and their storage usually reused
for something else) after the function in which they appear returns
control to the caller, UNLESS they are static. Objects declared
'static' have the lifetime beyond the scope in which they are defined
and you can access them from outside (given you have the address).
That said, don't get your hopes up. Accessing the object though its
address from another program depends on the operating system in which
your programs are running. If the OS supports virtual memory for
processes, you'll have to jump through lots of hoops (probably not
worth your time) to access one process' memory from entirely different
process. That's a topic for a discussion in the newsgroup dedicated
to your OS.
V