DLL’s, entry points and global variables in C++

I recently converted one of my libraries from a statically-linked lib to a DLL. But I found some problems – global variables declared in the DLL were not being initialized – and they ended up with null virtual-function pointers. The reason – I had checked “no entry point”. This seemed sensible as the DLL is a resource, and doesn’t do anything explicit on loading.

But apparently this means it will just leave your globals (actually static class members in my case) completely uninitialized. Neither Microsoft’s documentation, nor googling enlightened me much after discovering this behaviour.