I have never managed to get xlcAlert to work in functions. So, I use MessageBoxW. Here is an example, using your code as a starting point, which works:
__declspec(dllexport) LPXLOPER12 XLLShowMessageA (void)
{
static XLOPER12 xReturn;
int terNum, segNum, rc;
terNum = 1;
segNum = 2;
xReturn.xltype = xltypeNum;
xReturn.val.num = 0;
if (terNum < segNum)
{
MessageBoxW (NULL, L"User message.", L"Dialog title.",
MB_OK | MB_SETFOREGROUND );
return &xReturn;
}
return &xReturn;
}
David Wilkinson (UK)