Answer the question
In order to leave comments, you need to log in
How to run background code through DLLmain?
There is an application that pulls files from a folder. I want to write a library that will keep the server in the background. But DLLmain's return delays also hold up the application. And if you create a thread in dllmain, then it ends when DLlmain returns a value.
Answer the question
In order to leave comments, you need to log in
Hello.
Some program starts the process. The process loads a method from your DLL and executes that method.
A process can do anything, up to and including unloading your DLL from memory. Or it can end itself, thereby getting out of memory.
What to do?
Write your own program (with a server and goodies) that will work in isolation.
And your DLL should only run this program of yours in a separate CreateProcess () process.
https://docs.microsoft.com/en-us/windows/desktop/a...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question