Original Post
Drizzt DoUrden''s GDI: Hpen thread got deleted.
The answer to his question was:
if you are using C:
HPEN old_pen = (HPEN)SelectObject(hdc, hpen);
if you are using C++:
HPEN old_pen = static_cast(SelectObject(hdc, hpen));
This is because you have a void *. A void* is a pointer to a block of memory, but you don''t know what the memory is. You need to cast it. Check Stroustroup''s book for a good explanation of casts in C++.
Scott Meyer''s Essential C++ is also a good reference.