Heres an off the cuff type question... (been day-dreaming today between studying)...

Does anyone think it *could* be possible to build a single win32 EXE program, while at the same time able to be loaded as a DLL from another program?

IE) I want to run fancy_calc, i double click on it and run it..
and some other program or IDE can load it (the exe) as a suporting tool and call upon certain exported fuctions thru a DLL type interface to get the same behavior done.. ???

Or am i just mixing apples and oranges here?

Posted on 2001-12-04 22:58:23 by NaN
Yep --- FAsm 1.14:
Posted on 2001-12-05 00:40:08 by eet_1024
After some testing, it appears the the dummy function is executed on load AND close (when the user app exits)
Posted on 2001-12-05 00:57:32 by eet_1024
I've had major trouble with something similar, NaN. On some versions
of windows (9x, I think), it seems like .EXE files do not get relocated
even if they possess relocation information, and LoadLibrary on a
.exe file is limited to fiddling with resources. On win2k my test worked,
but you shouldn't be doing this. Look what PSDK has to say:

LoadLibrary can also be used to map other executable modules. For example, the function can specify an .exe file to get a handle that can be used in FindResource or LoadResource. However, do not use LoadLibrary to run an .exe file, use the CreateProcess function.

*** edit ***
You can of course think of *other* ways to get the second executable
doing it's work. You can set up a named pipe to communicate, for
Posted on 2001-12-05 09:21:42 by f0dder
Thanx all for your thoughts (and code snippets :) )..

I will play with them and see what conclusions i can come up with....

Posted on 2001-12-06 10:48:17 by NaN