When to use dllmain and when just use function in dll file?