Click to See Complete Forum and Search --> : exe/dll data exchange


drummor
December 7th, 2001, 10:01 AM
I've got a questuion: i have exe program which creates window(non MFC) and this programm loads dll, which creates another window. Both windows have edit controls. I need to do followng: as far as i change text in edit in dll window, i need to output same text in edit in exe window. There is a pointer (char*) in dll where i store text which is to be output in dll edit. How to access to this pointer from exe window (and make this pointer common for both windows - something like buffer). Probably I need to declare this pointer as dllexport but I don't know how to work with it then. Please somebody give example of solving such problem (using imported variables!). Thanks

TekBoy
December 9th, 2001, 01:34 PM
I would create an exported function in your DLL which returns a char** (a pointer to the char *), and in this return value pass the address of your char * to your EXE file.

drummor
December 9th, 2001, 01:47 PM
and if I need to get pointer to int** (for example there is some matrix) - i should return int*** - or i didn't understand something?

TekBoy
December 9th, 2001, 03:36 PM
yes, a pointer to an int** is a int***. Every * means pointer, and you can have many levels of pointers..... i.e. a pointer to a pointer....

if your char * you want to pass to your EXE is a constant, i.e. the pointer does not change, then it is sufficient to pass it to your EXE by value, not by pointer (char **).