Calling Another Program's Functions by References

Is calling a function of another running program by using the reference of that function a possibility? Suppose you create a square function in another program and you know the address of that function (somehow: i assume that you &nameoffunct). Now, you create another program that declares a pointer a function and assign the address of the function to your pointer to function in this other program. Is this possible? Why or why not? Is there anything similar to this?

I got this idea from Stephen Prada

You might know that 0xB8000000 is the combined segment-offset address of ideo memory on your system, but nothing in the statement tells the program that this number is an address.

int* pt;
pt = (int*) 0xB8000000;
// makes both right and left values have samequalifiers

No, you need some sort of RPC mechanism.
(Well, actually, you can, but it requires playing with compiler-specific options to manipulate the export table of the 'other program'. However, doing it by hard-coded addresses won't work on any modern multitasking, multiuser OS, since each process gets its own "virtual memory". ;-> )
Topic archived. No new replies allowed.