- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
i am trying to use tab controls. but compiler gives errors as follows. i already used "use comctl". what might be problem? besides, does it make different to use . instead of %? meaning, "itabmessages.code" or "itabmessages%code" ?
thank you...
...
type (T_NMHDR):: itabmessages
pointer (lptabm, itabmessages)
type (T_TCITEMHEADER) TabHead
type (T_INITCOMMONCONTROLSEX) iccex
iccex%dwSize = sizeof(iccex)
iccex%dwICC = ICC_TAB_CLASSES
Call initCommonControlsEx (iccex)
select case (message)
case (WM_INITDIALOG) ! initialize dialog box
hTab = GetDlgItem(hdlg,IDC_TAB)
if (hTab == 0) then
iret = MessageBox(Null, "error getting tab dialog"C,..)
end if
TabHead%mask = TCIF_TEXT
TabHead%cchTextMax = 12
szTab = "tab1"C
TabHead%pszText = loc(szTab)
iret = SendMessage (hTab, TCM_INSERTITEM , 0, loc(TabHead))
szTab = "tab2"C
TabHead%pszText = loc(szTab)
iret = SendMessage (hTab, TCM_INSERTITEM , 1, loc(TabHead))
hTabs1 = CreateDialogParam(ghInstance,IDD_DLG1,hTab,loc(DetectorDlgProc),0)
hTabs2 = CreateDialogParam(ghInstance,IDD_DLG2,htab,loc(VoltageDlgProc),0)
iret = ShowWindow(hTabs1,SW_SHOW)
call CenterTabs (hTabs1, hTab)
DlgProc = 1
return
case (WM_MOVE)
call CenterTabs (hTabs1, hTab)
call CenterTabs (hTabs2, hTab)
DlgProc = 1
return
case(WM_NOTIFY)
lptabm = lparam
if(itabmessages.code == TCN_SELCHANGE) then
hTab = itabmessages%hwndFrom
iTabNo = SendMessage( hTab ,TCM_GETCURSEL,0,0)
if(iTabNo == 0) then
iret = ShowWindow(hTabs1,SW_SHOW)
iret = ShowWindow(hTabs2,SW_HIDE)
call CenterTabs (hTabs1, hTab)
elseif(iTabNo == 1) then
iret = ShowWindow(hTabs2,SW_SHOW)
iret = ShowWindow(hTabs1,SW_HIDE)
call CenterTabs (hTabs2, hTab)
end if
end if
DlgProc = 1
return
end select
DlgProc = 0 ! Didn't process the message
return
end
Error: This derived type name has not been declared. [T_TCITEMHEADER]
type (T_TCITEMHEADER) TabHead
--------------^
Error: This name does not have a type, and must have an explicit type. [ITABHEAD]
TabHead%mask = TCIF_TEXT
i am trying to use tab controls. but compiler gives errors as follows. i already used "use comctl". what might be problem? besides, does it make different to use . instead of %? meaning, "itabmessages.code" or "itabmessages%code" ?
thank you...
...
type (T_NMHDR):: itabmessages
pointer (lptabm, itabmessages)
type (T_TCITEMHEADER) TabHead
type (T_INITCOMMONCONTROLSEX) iccex
iccex%dwSize = sizeof(iccex)
iccex%dwICC = ICC_TAB_CLASSES
Call initCommonControlsEx (iccex)
select case (message)
case (WM_INITDIALOG) ! initialize dialog box
hTab = GetDlgItem(hdlg,IDC_TAB)
if (hTab == 0) then
iret = MessageBox(Null, "error getting tab dialog"C,..)
end if
TabHead%mask = TCIF_TEXT
TabHead%cchTextMax = 12
szTab = "tab1"C
TabHead%pszText = loc(szTab)
iret = SendMessage (hTab, TCM_INSERTITEM , 0, loc(TabHead))
szTab = "tab2"C
TabHead%pszText = loc(szTab)
iret = SendMessage (hTab, TCM_INSERTITEM , 1, loc(TabHead))
hTabs1 = CreateDialogParam(ghInstance,IDD_DLG1,hTab,loc(DetectorDlgProc),0)
hTabs2 = CreateDialogParam(ghInstance,IDD_DLG2,htab,loc(VoltageDlgProc),0)
iret = ShowWindow(hTabs1,SW_SHOW)
call CenterTabs (hTabs1, hTab)
DlgProc = 1
return
case (WM_MOVE)
call CenterTabs (hTabs1, hTab)
call CenterTabs (hTabs2, hTab)
DlgProc = 1
return
case(WM_NOTIFY)
lptabm = lparam
if(itabmessages.code == TCN_SELCHANGE) then
hTab = itabmessages%hwndFrom
iTabNo = SendMessage( hTab ,TCM_GETCURSEL,0,0)
if(iTabNo == 0) then
iret = ShowWindow(hTabs1,SW_SHOW)
iret = ShowWindow(hTabs2,SW_HIDE)
call CenterTabs (hTabs1, hTab)
elseif(iTabNo == 1) then
iret = ShowWindow(hTabs2,SW_SHOW)
iret = ShowWindow(hTabs1,SW_HIDE)
call CenterTabs (hTabs2, hTab)
end if
end if
DlgProc = 1
return
end select
DlgProc = 0 ! Didn't process the message
return
end
Error: This derived type name has not been declared. [T_TCITEMHEADER]
type (T_TCITEMHEADER) TabHead
--------------^
Error: This name does not have a type, and must have an explicit type. [ITABHEAD]
TabHead%mask = TCIF_TEXT
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use T_TCITEM instead. T_TCITEMHEADER is new name, not implemented in CVF v.6
Jugoslav
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
was it that tiny stuff? ok, let me see.
thank you Jugoslav
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page