As far as I know, exe and dll are essentially the same thing, only in dll there is an export table . Earlier I tried to export something simple from exe (like Sleep() ). Now there is a need for it, but everything is complicated. What's happening:

I load the file from another file with LoadLibrary() ( GetLastError() returns 0), I get the function GetProcAdress() ( GetLastError() all also returns zero). In the version that exports, about the code

 extern"C" _declspec(dllexport) void go(); static int a=0; void go() { a=1; } 

Actually the question:

If an exe with the exported function is already running, and I load it from the second exe and call go() , will the variable a change in an already running process?

  • Well, what hands do not check? - strangeqargo 9:16 pm
  • @strangeqargo, the function is not called - Arthur Klochko
  • By the way, the question is, what is not in the dll, what is in exe? - strangeqargo
  • @strangeqargo, you ask why I do not use dll? Ekze want to use as server - Arthur Klochko
  • you said that there is almost no difference between exe and dll, I just ask how exe differs from dll except for having export table in dll - strangeqargo

1 answer 1

Not.

If you are loading a module, then you will actually have a separate instance of the module that is not related to the same module as part of another process. Each process will have its own set of static variables.

(There is no difference between exe and dll, so with dll it would be the same.)

  • Yeah, got it. Well then WM_COPYDATA - Arthur Klochko