Carlos,
Most likely it caused by the requirement to
lpszText,
lpszCaption and
lpszIcon members of the MSGBOXPARAMS structure to be pointers to strings.
In your code you insert strings in the structure directly. The other members become virtually displaced, which makes the system unable to recognize them properly.
Use GlobalAlloc or LocalAlloc or any other memory allocation routine and pass the resulting pointer to the structure. Don't forget to release the memory in the end.
* * *
I just made a quick test of this function. It has confirmed
lpszText,
lpszCaption to be pointers to strings rather than the strings themselves. The first member,
cbSize, should be set to 40 bytes, the size of the structure.
Also
lpszIcon should be a resource identifier. I don't think it can be an icon filename.