Dan McCarty
2005-05-24 18:14:51 UTC
Is sending a pointer to data in the LPARAM of PostMessage() an
acceptable way to pass data to a window?
If so, is there any value to checking the size of the passed pointer in
the message handler on the receiving end? e.g.,
ASSERT(sizeof((MonetJobTp &) pNewData) == sizeof(MonetJobTp));
I'm not sure whether this checks the size of pNewData against a
MonetJobTp struct or whether it just forces pNewData to align with a
MonetJobTp struct and always passes the test.
Is it better to just ASSERT(pNewData) to ensure it's a valid pointer
and leave it at that?
acceptable way to pass data to a window?
If so, is there any value to checking the size of the passed pointer in
the message handler on the receiving end? e.g.,
ASSERT(sizeof((MonetJobTp &) pNewData) == sizeof(MonetJobTp));
I'm not sure whether this checks the size of pNewData against a
MonetJobTp struct or whether it just forces pNewData to align with a
MonetJobTp struct and always passes the test.
Is it better to just ASSERT(pNewData) to ensure it's a valid pointer
and leave it at that?