I am working on a project where using Cocoa and Objective C is not desired.

I stumbled across the Objective C runtime library the other day and have been trying to use it to access the dimensions of the screen.

This is the code I have currently:

```
auto screen = objc_msgSend(objc_lookUpClass("NSScreen"),sel_getUid("mainScreen")); //Returns an NSScreen*
auto frame = objc_msgSend(screen, sel_getUid("frame")); // should return an NSRect but I get an EXC_BAD_ACCESS and the program quits

```

Using Cocoa isn't an option and Carbon isn't really supported anymore.
I'm hoping that someone is familiar with the Objc Runtime and is able to solve this problem.