dllmain() is only optional in a c/c++ program because the linker will link in a dummy/empty dllmain() if you don't provide one.
a DLL always has an entrypoint. The exceptions are a resource only...