Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How do i get full path to "My Documents" dir? Pin
Rob Manderson11-Jan-04 13:46
protectorRob Manderson11-Jan-04 13:46 
AnswerRe: How do i get full path to "My Documents" dir? Pin
murali_utr11-Jan-04 18:29
murali_utr11-Jan-04 18:29 
Generaldebugger problem Pin
User 58385211-Jan-04 9:55
User 58385211-Jan-04 9:55 
GeneralRe: debugger problem Pin
Roger Allen12-Jan-04 0:45
Roger Allen12-Jan-04 0:45 
GeneralWhen should I delete ServerSocket when client shutdown Pin
white jungle11-Jan-04 5:21
white jungle11-Jan-04 5:21 
GeneralRe: When should I delete ServerSocket when client shutdown Pin
valikac11-Jan-04 6:03
valikac11-Jan-04 6:03 
GeneralRe: When should I delete ServerSocket when client shutdown Pin
white jungle11-Jan-04 6:59
white jungle11-Jan-04 6:59 
GeneralLV & TV strange behavior Pin
GeraldoLuiz11-Jan-04 1:49
GeraldoLuiz11-Jan-04 1:49 
Hi, I've never used label editing in TreeView & ListView before, so I guess it's a simple question. I used the EditLabels property (LVS/TVS_EDITLABELS) and create the controls. But a strange thing happens. I click on the label to edit and it's ok, but when I press any key (in both the TV and LV) the dialog is dismissed. Also, when I press ENTER (without any char has been pressed), they behave differently: the LV accepts it but the TV close the dialog.
What is happening ? What is missing here ?

I create a very simple test: a new Win32 App,typical HelloWorld, and include this lines in teste.rc:

CONTROL "List1",100,"SysListView32",LVS_REPORT | LVS_SINGLESEL |
LVS_SHOWSELALWAYS | LVS_EDITLABELS | LVS_NOSORTHEADER |
WS_BORDER | WS_TABSTOP,7,7,132,30
CONTROL "Tree1",200,"SysTreeView32",TVS_HASBUTTONS |
TVS_HASLINES | TVS_EDITLABELS | TVS_SHOWSELALWAYS |
WS_BORDER | WS_TABSTOP,7,43,158,24,WS_EX_CLIENTEDGE

and include InitCommonControls(); at WinMain and
#include "commctrl.h" and put comctl32.lib in the project settings

finally I put this on the About function:

case WM_INITDIALOG:
LVCOLUMN col;
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.pszText = _T("Col1");
col.cx = 100;
ListView_InsertColumn(GetDlgItem(hDlg, 100), 0, &col);

LVITEM lv;
lv.mask = LVIF_TEXT;
lv.pszText = _T("Txt1");
lv.iItem = 0;
lv.iSubItem = 0;
ListView_InsertItem(GetDlgItem(hDlg, 100), &lv);

TVINSERTSTRUCT tv;
tv.hInsertAfter = TVI_LAST;
tv.item.mask = TVIF_TEXT;
tv.hParent = TVI_ROOT;
tv.item.pszText = _T("root");
TreeView_InsertItem(GetDlgItem(hDlg, 200), &tv);
return TRUE;

and that's it. I didn't include the handlers to LVN/TVN_BEGINLABELEDIT and ENDLABELEDIT , but I think this is not the problem. Why the dialog is dismissed when I press any key ? Why the ENTER key is OK with LV but close the dialog in TV ? Did I forget to handle some message or notification here ?
Did they act differently in Windows and Dialogs ?
GeneralRe: LV & TV strange behavior Pin
GeraldoLuiz11-Jan-04 11:49
GeraldoLuiz11-Jan-04 11:49 
Generalc++ file transfer between client\server Pin
Anonymous11-Jan-04 1:33
Anonymous11-Jan-04 1:33 
GeneralRe: c++ file transfer between client\server Pin
Johnny ²11-Jan-04 2:40
Johnny ²11-Jan-04 2:40 
GeneralRe: c++ file transfer between client\server Pin
valikac11-Jan-04 6:07
valikac11-Jan-04 6:07 
GeneralRe: c++ file transfer between client\server Pin
Jörgen Sigvardsson11-Jan-04 7:14
Jörgen Sigvardsson11-Jan-04 7:14 
GeneralRe: c++ file transfer between client\server Pin
Anonymous11-Jan-04 11:21
Anonymous11-Jan-04 11:21 
Question__fastcall and naked keyword? Pin
Alexander M.,10-Jan-04 23:53
Alexander M.,10-Jan-04 23:53 
AnswerRe: __fastcall and naked keyword? Pin
John R. Shaw11-Jan-04 5:11
John R. Shaw11-Jan-04 5:11 
GeneralRe: __fastcall and naked keyword? Pin
Alexander M.,11-Jan-04 6:53
Alexander M.,11-Jan-04 6:53 
GeneralRe: __fastcall and naked keyword? Pin
Jörgen Sigvardsson11-Jan-04 7:16
Jörgen Sigvardsson11-Jan-04 7:16 
GeneralRe: __fastcall and naked keyword? Pin
Jörgen Sigvardsson11-Jan-04 7:18
Jörgen Sigvardsson11-Jan-04 7:18 
GeneralRe: __fastcall and naked keyword? Pin
Alexander M.,11-Jan-04 8:39
Alexander M.,11-Jan-04 8:39 
GeneralRe: __fastcall and naked keyword? Pin
Jörgen Sigvardsson11-Jan-04 8:47
Jörgen Sigvardsson11-Jan-04 8:47 
Generalmultithreading Pin
NewYork10-Jan-04 23:46
NewYork10-Jan-04 23:46 
GeneralRe: multithreading Pin
valikac11-Jan-04 6:09
valikac11-Jan-04 6:09 
GeneralRe: multithreading Pin
Joe Woodbury11-Jan-04 14:27
professionalJoe Woodbury11-Jan-04 14:27 
Generalmultithreading Pin
NewYork10-Jan-04 23:46
NewYork10-Jan-04 23:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.