As you can tell by the source, it's not a very simple thing to do. Lots of parsing and bit conversions. I have a much simpler method using C++. I REALLY discourage Copy and Paste.. So please try to actually understand what's going on in this code and not just putting it in your project.
This is a new header file we're going to create. I've named mine Addresses.h
You can see this is much simpler in C++ because we can simply use GetModuleHandle.
DWORD GetAddress(DWORD addie, LPCSTR module)
DWORD address = address1+address2;
To call this function we would then, in our source, do the following..
Again, I highly discourage copy+paste. This source isn't too complex, read though it and try to understand it, then implement.
DWORD OurAddress = (DWORD)GetAddress(0x00000000,"OurModuleHere");