Question: In C++, can I simply cast a pointer to a DWORD?

```
MyClass * thing;
DWORD myPtr = (DWORD)thing;

```

Would that work?

Answer: 
In windows its quite common to pass pointers in such way, for example in windows messages. LPARAM is a typedef for LONG\_PTR and quite often is used to pass pointers to some structures. You should use `reinterpret_cast<DWORD_PTR>(thing)` for casting.
No, in a 64 bit process, a pointer is 64 bits but a DWORD is only 32 bits. Use a DWORD\_PTR.