Hi all,
Troubles with CONTROL ADD "Custom". I've created and registered a class successfully using:
But when I create the control using:
no hWnd to the control is created: CONTROL HANDLE returns 0. In addition, ERR is 0 after the CONTROL ADD call.
The actual "control" is a DLL that has it's own functions for drawing and updating the control contents; all it needs
is a valid control hWnd. For example, the C code for creating & presenting the control is just three lines:
This leads me to wonder, are there certain types of "custom" controls that aren't compatible with DDT? If not, anyone have
any idea what I'm doing wrong?
Thanks!
------------------
Mark Newman
Troubles with CONTROL ADD "Custom". I've created and registered a class successfully using:
Code:
szName = "MyControl" wc.cbSize = SizeOf(wc) wc.style = %CS_HREDRAW OR %CS_VREDRAW OR %CS_PARENTDC OR %CS_GLOBALCLASS wc.lpfnWndProc = CodePtr(frmMain_DLGPROC) wc.cbClsExtra = 0 wc.cbWndExtra = 0 wc.hInstance = GetModuleHandle (ByVal 0) wc.hIcon = %NULL wc.hCursor = LoadCursor(%NULL, ByVal %IDC_ARROW ) wc.hbrBackground = GetStockObject(%NULL_BRUSH) wc.lpszMenuName = %NULL wc.lpszClassName = VarPtr(szName) wc.hIconSm = %NULL lSuccess = RegisterClassEx(wc)
Code:
Control Add "MyControl", hDlg, %MYCONTROL, "Title", 1,50,300,150, %WS_VISIBLE Or %WS_TABSTOP Or %WS_CHILD, 0&
The actual "control" is a DLL that has it's own functions for drawing and updating the control contents; all it needs
is a valid control hWnd. For example, the C code for creating & presenting the control is just three lines:
Code:
hwndControl = GetDlgItem(hWnd, IDCUSTOM); hControlData = ControlCreate(); // DLL call: Creates the control and returns a handle to the control's data ControlAttachWindow(hControlData, hwndControl); // DLL call: Attaches the control to the control's window handle
any idea what I'm doing wrong?
Thanks!
------------------
Mark Newman
Comment