I have work I need to complete in a DLL as soon as it is loaded. The work involves synchronization and so can’t be done inside dllmain. Is there a way to trigger code to execute as soon as dllmain (or all dllmains) is complete?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to this MSDN post:
If this holds true, then you should be able to do your work in the Thread in question, which will not start until the DLLMain has completed. Of course this leaves some possible synchronization issues open, If you use a Mutex maybe you can resolve this.
NOTE: I have not tried this, it just looks like in theory it might work.
P.S. If you try it pls leave a comment on whether it worked or not.