Hi, I have one problem: how is it possible to notify an EXE about changes form DLL? I mean, is it possible to orginize some kind of a global variable, between DLL & EXE? Or how is it possible to pass some data directly form DLL to EXE and vice versa? Sorry for BAD english one more time...
Posted on 2001-03-22 11:51:00 by DMD
A DLL that is loaded in an executable will share the same memory space as that executable, so it will have access to the same memory! All you need to do is provide some mechanism for letting the DLL know where the memory is, the easiest is to pass by reference.

invoke MyDLLFunc, ADDR ThatBigStructureIWantToShare, X, Y, Z

...

;In your DLLs code

MyDLLFunc PROC a:DWORD, b:DWORD, c:DWORD, d:DWORD
mov eax, a
mov (BigStructure PTR ).b, b
mov (BigStructure PTR ).c, c
mov (BigStructure PTR ).d, d
ret
MyDLLFunc endp
And when the function returns "ThatBigStructureIWantToShare" will contain the data set in "MyDLLFunc". Mirno
Posted on 2001-03-22 12:06:00 by Mirno
Of cource I knew this. But I meant that to use some GLOBAL variable, which does not belong to any of the moduls/functions, so as it will be availible to any module inside the DLL and THIS variable will be availible for my EXE code. That is it!
Posted on 2001-03-22 12:28:00 by DMD
DMD, There's a wonderful scene in "The Princess Bride" where Vizzini, after repeatedly using the term "INCONCEIVABLE" is gently reproached by Inigo with the phrase; "You keep using that word. I do not think it means what you think it means." DMD: I do not think it means what you think it means. Mirno was quite correct in what he told you. Please note that when he said pass the address of ThatBigStructureIWantToShare, he did not first declare this struct as LOCAL or GLOBAL or in any way. That's because the way you pass things back and fourth to a dll (by memory address) doesn't care how the memory was alocated. Pass a single DWORD, pass a megabyte structure, all the same. ------------------- "HELLO. My name is Inigo Montoya. You killed my father. Prepare to die." This message was edited by Ernie, on 3/22/2001 7:25:22 PM
Posted on 2001-03-22 18:24:00 by Ernie