Weird error in Release Mode, posting messages

Hi:

Sorry about my english, I know it doens't very well. Now I will try to explain my problem.

In a Dll, I have defined three user-message types as follow:

---

#define WM_SIMULATION_END (WM_USER + 0x0F0)
#define WM_SIMULATION_ERROR (WM_USER + 0x0F1)
#define WM_THREAD_READY (WM_USER + 0x0F2)
#define WM_INFORM (WM_USER + 0x0F3)

---

When I try to post some of this messages at the window parent (Used PostMessage Function SDK), in Debug mode, all the functionality works correctly, but in Release mode, The Application shows an Exception Error. GetLastError function returns 183. This error means that "A File Exists cannot be created" .(It doesn't mean anything because I don't work with files).

If I debug this Exception Error, the Debugger drives me to the next code lines: (Windows Code)

---

void* CMapPtrToPtr::GetValueAt(void* key) const
// find value (or return NULL -- NULL values not different as a result)
{
if (m_pHashTable == NULL)
return NULL;

UINT nHash = HashKey(key) % m_nHashTableSize;

// see if it exists
CAssoc* pAssoc;
for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL; pAssoc = pAssoc->pNext)
{
if (pAssoc->key == key)
return pAssoc->value;
}
return NULL;
}

---

What is the meaning of that?

Can you help me??

Thanks for all

Regards

David
[1523 byte] By [cbing] at [2007-11-15 22:24:37]
# 1 Re: Weird error in Release Mode, posting messages
Check that your function prototypes for the ONMessages() match what they are required to be. In debug mode, the stack is cleaned up differently so that this error does not occur with incorrect parameter counts. I had this problem once and it took ages to realise what the cause was.

Roger Allen
Roger.Allen@sirius-analytical.com
I would like to think I helped, but I have trouble doing even that.
Roger Allen at 2007-11-10 3:05:45 >
# 2 Re: Weird error in Release Mode, posting messages
Thanks for all.

I checked the BEGIN_MESSAGE_MAP section, and all definitions are right.

If I Find the solution, I will email you with it OK?

Thanks again

Regards

David
cbing at 2007-11-10 3:06:49 >
# 3 Re: Weird error in Release Mode, posting messages
check the message handler signatures, not the message map.
your message handler signature should be like this
LRESULT MsgHandler(WPARAM wParam,LPARAM lParam)

i had the same problem too, until i read an article by joseph newcomer , it's available on codeproject.com, also check this article in msdn

"PRB: Incorrect Function Signatures May Cause Problems in Release "
ID: Q195032
regards,
da snoop
snoopy779ind at 2007-11-10 3:07:48 >