I have an application in mind, but I am not sure how to do this. Say I have some publically accessible method in a DLL file that takes no parameters. Is it possible for this method to know what called it? Can it tell if it were called from a static or instantiated context? From a specific class? What can a method know about how it’s being called?
Share
You can get caller information from a stack trace:
It is possible for this method to know what called it:
It can tell if it were called from a static or instantiated context:
From a specific class: