Error using module_invoke_all('requirements', 'runtime') in my custom module Why do I get

Additional uncaught exception thrown while handling exception.
Original
Exception: theme() may not be called until all modules are loaded. in theme() (line 920 of C:\wamp\www\test\includes\theme.inc).
Additional
Exception: theme() may not be called until all modules are loaded. in theme() (line 920 of C:\wamp\www\test\includes\theme.inc).

when try to call
    module_invoke_all('requirements', 'runtime')

from my custom module?
My guess would be that you have that line of code outside a function in your module. That doesn't work.

I have no idea what you are trying to do but you should at least move it into a hook, like hook_init() so that it's only executed when Drupal is fully bootstrapped.