Once the token and parameter structures have been allocated and initialized, your DLL can send the token to GroupWise by sending a message to the link window.
DWORD WINAPI SendTkn ( MAC_TOKENID wTknID, WORD nParmCnt,LPLPMAC_RETURNVAL lplpTknReturn ) { TPH_RETURNVAL TknData; LPTPH_RETURNVAL lpTPHData; // Fill global token structure // lpTknData-hszCommand = NULL; lpTknData-hszRequestor = (HSZ)hRequestor; lpTknData-dwMacroID = 0L; lpTknData-wTokenID = wTknID; lpTknData-cParam = nParmCnt; lpTknData-dwFlags = NULL; lpTknData-dwReserved = NULL; // Fill ReturnVal structure // TknData.lpTokenData = lpTknData; TknData.lplpmacRetVal = lplpTknReturn; lpTPHData = TknData; // Valuereturning token // dwRV = SendMessage (WPLnkWnd, WPLM_EXECUTE_VALRETURN_TOKEN, 0, (LPARAM)lpTPHData);FreePtr (lpTknData);return dwRV; } // End of SendTkn( ) function //
The following values can be returned.
Return Value |
Description |
---|---|
DLL_HAN_NOT_HANDLED |
The token was not processed. |
DLL_HAN_NO_ERROR |
The token was processed with no error. |
DLL_HAN_NOT_FOUND |
The token resulted in a GroupWise not found condition. |
DLL_HAN_CANCEL |
The user cancelled the function. |
DLL_HAN_TOKEN_ERROR |
The token was not valid. |
DLL_HAN_PARM_ERROR |
One or more of the parameters were invalid. |
lpTPHData is a long pointer to the TPH_RETURNVAL structure.
WPLM_EXECUTE_VALRETURN_TOKEN is the msg parameter passed to TokenHandle.
hLinkWindow is the link window handle passed to TokenHandle.
SendMessage returns a value indicating the token processing result defined below. If the message is successful and the token can return a value, TPH_RETURNVAL structure (lpTPHData) is filled in with data.
SendTkn sends the token structure to the link window using SendMessage.