inst is initialized in .cpp file in .dll project.
How do you know that for sure?
Put a break point in the DLL where inst gets initialized and see if it gets caught.

Also initialize it to NULL when you start the application, so if the DLL does initialize it later, it will change from NULL.
And where you call it, first test for NULL.

If you put a break point on that call, some debuggers (like MSVS) will tell you if the pointer is dirty or not.
So that is another check.
Also, at some point you need to get the pointer from the DLL, put a break point there and see if it gets caught before you call the code you posted above.
If not, 'inst' is not initialized.