Embed main() into a DLL

Discussion in 'Win32' started by stolencoin, Aug 31, 2010.

  1. stolencoin

    stolencoin New Member

    Joined:
    Aug 31, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi All

    Is it possible to embed the main() function into a DLL?

    I have searched the forums here, but none of 28 threads seem to have a relevant information. Note that I'm not talking about DllMain.

    For those who are interested why I want to do something like this. I have written my own service stuff (plain C/WIN32 API), and now I want to put it in a library. The concept works as a static library (I can create a static lib, link the application against this lib, implement in the app the functions required by the service lib, the service lib calls for example an application defined servicestopping() function when someone wants to stop the server, ..., this is all ok). Now I want to transform this static service library to a service dll. Is this possible?

    I don't need all the service related baggage as an example. If this is possible, could someone point me to an example where a main() function resides in a dll, and this main() acts as the main function of another project. Thanks
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice