Hi,

I upgraded my PScript printer driver plug-in to the latest
DDK i.e., XP SP1 DDK and all my balloon tips are not
working now. After some debugging I found out that
registration for the tootip control is failing i.e., my
SendMesssage command with TTM_ADDTOOL fails and return
false. There is no error registered, when I called
GetLastError() it returns success. Same code worked when I
compiled under older windows 2000 DDK.

Also attached is the code snippet.

Thanks,

Athar Ahmad.
Sr. Software Engineer.
MINOLTA-QMS Inc.

///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
////////////////////////

static LRESULT RegisterBalloonTips(HWND hDlg)
{
//Ensure that the DLL containing the tooltip control is
loaded

INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(INITCOMMONCONTROLSEX);
InitCtrls.dwICC = ICC_WIN95_CLASSES;
BOOL InitCtrlsOk = InitCommonControlsEx(&InitCtrls);

//Create the tooltip control
hwndBalloonTip = CreateWindowEx(NULL, TOOLTIPS_CLASS,
NULL, WS_EX_TOOLWINDOW | WS_POPUP | TTS_NOPREFIX |
TTS_BALLOON | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, hDlg, NULL, ghInstance,
NULL);

SetWindowPos(hwndBalloonTip, HWND_TOPMOST,0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);

//Activate the tooltip control
SendMessage(hwndBalloonTip, TTM_ACTIVATE, (WPARAM) TRUE,
(LPARAM) 0);

//Force multi-line ballloon tip
SendMessage(hwndBalloonTip, TTM_SETMAXTIPWIDTH, 0,
MAX_BALLOON_TIP_WIDTH);

//Preset the return code
LRESULT TTMOk = TRUE;
//Set arguments shared among tools
ToolInfo.cbSize = sizeof(TOOLINFO);
ToolInfo.uFlags = TTF_IDISHWND | TTF_TRACK ;
ToolInfo.hwnd = hDlg;
ToolInfo.hinst = NULL;
ToolInfo.lParam = 0;
ToolInfo.lpszText = LPSTR_TEXTCALLBACK;

//Register tools with tooltip control
ToolInfo.uId = (UINT_PTR)GetDlgItem(hDlg, IDC_WIDTH);
TTMOk = (SendMessage (hwndBalloonTip, TTM_ADDTOOL,
(WPARAM) 0, (LPARAM) &ToolInfo) == TRUE) ? TTMOk : FALSE;

//Register tools with tooltip control
ToolInfo.uId = (UINT_PTR)GetDlgItem(hDlg, IDC_HEIGHT);
TTMOk = (SendMessage (hwndBalloonTip, TTM_ADDTOOL,
(WPARAM) 0, (LPARAM) &ToolInfo) == TRUE) ? TTMOk : FALSE;


return TTMOk;
}

RE: Windows DDK (XP SP1) by ashwinn

ashwinn
Mon Sep 08 11:27:57 CDT 2003

------=_NextPart_0001_E45C29C2
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I cannot be sure of this since I have not repro'd or debugged your
particular issue. But we encountered an issue with TTM_ADDTOOL and the DDK.
The root cause was a mismatch between version 5 and version 6 of
comctl32.dll. A workaround, although not clean, was to set the cbsize
element of the TOOLINFO structure to be smaller by the size of the
lpReserved void pointer. As I mentioned, I am not sure if this is the exact
same issue you are facing. It is difficult to say for sure without reproing
and debugging the issue. If this is an important enough problem for you, I
suggest that you open a support incident for the issue. If it does turn out
to be a Microsoft bug, you will not be charged for it.

- Ashwin

This posting is provided "AS IS" with no warranties, and confers no rights.

------=_NextPart_0001_E45C29C2
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 I cannot be sure of this since I have not repro'd or debugged your particular issue. But we encountered an issue with TTM_ADDTOOL and the DDK. The root cause was a mismatch between version 5 and version 6 of comctl32.dll. A workaround, although not clean, was to set the cbsize element of the TOOLINFO structure to be smaller by the size of the lpReserved void pointer. As I mentioned, I am not sure if this is the exact same issue you are facing. It is difficult to say for sure without reproing and debugging the issue. If this is an important enough problem for you, I suggest that you open a support incident for the issue. If it does turn out to be a Microsoft bug, you will not be charged for it.
\par
\par - Ashwin
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par }
------=_NextPart_0001_E45C29C2--


RE: Windows DDK (XP SP1) by Athar

Athar
Thu Sep 11 08:43:13 CDT 2003

Thank you Ashwin,

After doing some more debugging I found out the exact same
problem explanation. After reducing the size by the size
of the void pointer, every thing seems to be working fine.

Thanks,
Athar.