Click here to Skip to main content
15,905,232 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionsave a text file Pin
Siddam7-Feb-07 18:12
Siddam7-Feb-07 18:12 
AnswerRe: save a text file Pin
Ravi Bhavnani7-Feb-07 18:15
professionalRavi Bhavnani7-Feb-07 18:15 
GeneralRe: save a text file Pin
Hamid_RT7-Feb-07 18:23
Hamid_RT7-Feb-07 18:23 
AnswerRe: save a text file Pin
Siddam7-Feb-07 19:19
Siddam7-Feb-07 19:19 
AnswerRe: save a text file Pin
prasad_som7-Feb-07 19:28
prasad_som7-Feb-07 19:28 
GeneralRe: save a text file Pin
Hamid_RT7-Feb-07 20:03
Hamid_RT7-Feb-07 20:03 
GeneralRe: save a text file Pin
Hamid_RT8-Feb-07 6:02
Hamid_RT8-Feb-07 6:02 
QuestionHow one can update child dialog? Pin
amitmistry_petlad 7-Feb-07 17:07
amitmistry_petlad 7-Feb-07 17:07 
hi! All
I need to update the child dialog window from some other window how can i do I have did the folllowing for that.

//the following dialog having the listview control on event(NM_CLICK) of that listitem the other
window show.
i have did the following way.

LRESULT CALLBACK GlobaListProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
       
          .
          .
          .
          .
          .
          .


case WM_NOTIFY:
		{
			switch(LOWORD(wParam))
			{
			    case IDC_LIST4: 
				
				LPNMLISTVIEW pnm = (LPNMLISTVIEW)lParam;

                if(pnm->hdr.hwndFrom == hList &&pnm->hdr.code == NM_CUSTOMDRAW)
                {
                 //   SetWindowLong(hWnd, DWL_MSGRESULT, (LONG)ProcessCustomDraw(lParam));
                    return TRUE;
                }

				if(((LPNMHDR)lParam)->code == LVN_KEYDOWN)
				{				
					 LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)lParam;
					 if( pLVKeyDow->wVKey == VK_DELETE )
					{				
					int iSlected=0;
					iSlected=SendMessage(hList,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
					if(iSlected==-1)
					  {
	
	MessageBox(hList,_T("No Items in ListView"),_T("Error"),MB_OK|MB_ICONINFORMATION);
	break;
           					}				
					 ListView_DeleteItem(hList,iSlected);		
					}
				}			
				
                if(((LPNMHDR)lParam)->code == NM_RCLICK)
				{					    
					
					HMENU hMenu = LoadMenu (NULL, MAKEINTRESOURCE (IDR_MENU1));
					HMENU hPopupMenu = GetSubMenu (hMenu, 0);
					POINT pt;
					SetMenuDefaultItem (hPopupMenu, -1, TRUE);
					GetCursorPos (&pt);
			TrackPopupMenu (hPopupMenu,TPM_LEFTALIGN, pt.x, pt.y, 0, hDlg, NULL);
					DestroyMenu (hPopupMenu);
					DestroyMenu (hMenu);
					
				}
							
	<code>			
				if(((LPNMHDR)lParam)->code == NM_CLICK)
				{
					iSelect=SendMessage(hList,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);				    
					if(iSelect==-1)
					{                      
					  break;
					}					
					index=iSelect;		
					ShowWindow(hWndinoutfiledir,SW_HIDE);			
					ShowWindow(hwndEncrypt,SW_HIDE);					
					//Hide File Split window.
					ShowWindow(hwndSplit,SW_HIDE);
					//Hide encoder window.			
					ShowWindow(hwndUpload,SW_HIDE);
					<big>ShowWindow(hwndTagEditorDlg ,SW_SHOW);</big>					UpdateWindow(hwndTagEditorDlg);
				}  </code>	
			

               
                break;
			}
		}

		break;

}


//show show the following dialog



LRESULT CALLBACK  TagEditorProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{

Utility util;

switch(message)
{
case WM_INITDIALOG: //when i click it second mor third time this event doesnt call,inspite of i  called UpdateWindow(hwndTagEditorDlg); why ?

if(_ProtectSet[index].listviewIndex==index) 
		{
SetDlgItemText(hDlg,IDC_EDIT_ARTIST,util.ConvertStringToWCHAR(_ProtectSet[index].artist));  
SetDlgItemText(hDlg,IDC_EDIT_ALBUM,util.ConvertStringToWCHAR(_ProtectSet[index].album));
//SetDlgItemText(hDlg,IDC_EDIT_YEAR,util.ConvertStringToWCHAR(_ProtectSet[index].year));
SetDlgItemText(hDlg,IDC_EDIT_COPYRIGHT,util.ConvertStringToWCHAR(_ProtectSet[index].copyright));
SetDlgItemText(hDlg,IDC_EDIT_AUTHOR,util.ConvertStringToWCHAR(_ProtectSet[index].author));
SetDlgItemText(hDlg,IDC_EDIT_GENRE,util.ConvertStringToWCHAR(_ProtectSet[index].genre));
SetDlgItemText(hDlg,IDC_EDIT_DESCRIPTION,util.ConvertStringToWCHAR(_ProtectSet[index].desc));
		}
	break;

case WM_COMMAND:

switch(LOWORD(wParam))
{
case IDC_SAVE_TAG:	
	_ResideId3TagForSelectedFile(hDlg);			
	break;	
	
} 
 break;
}
return FALSE;
}


void _ResideId3TagForSelectedFile(HWND hDlg)
{     
 //std::vector  multiset <string,string,string,string,string,string,string,string,string,string> TAG3 t;
 //TagEditor _ProtectSet[MAX_PATH];declare global 	
	static int i=0;	
	Utility util;	
	TCHAR buff[MAX_PATH];
	ListView_GetItemText(hList,index,0,(LPWSTR)&buff,MAX_PATH);
	std::wstring buff_input(buff);	
	std::string compare(buff_input.begin(),buff_input.end());

	WCHAR w_Artist[MAX_PATH],w_Title[MAX_PATH],w_Album[MAX_PATH],w_Year[MAX_PATH],w_Copyright[MAX_PATH],w_Author[MAX_PATH];
	WCHAR w_Gener[MAX_PATH],w_Desc[MAX_PATH];
	
	string str_Artist,str_Title,str_Album,str_Year,str_Copyright,str_Authour,str_Gener,str_Desc;	

	
	GetDlgItemText(hDlg,IDC_EDIT_ARTIST,w_Artist,MAX_PATH); 
	GetDlgItemText(hDlg,IDC_EDIT_TITLE,w_Title,MAX_PATH); 
	GetDlgItemText(hDlg,IDC_EDIT_ALBUM,w_Album,MAX_PATH); 
	GetDlgItemText(hDlg,IDC_EDIT_YEAR,w_Year,MAX_PATH); 
	GetDlgItemText(hDlg,IDC_EDIT_COPYRIGHT,w_Copyright,MAX_PATH); 
	GetDlgItemText(hDlg,IDC_EDIT_AUTHOR,w_Author,MAX_PATH); 
	GetDlgItemText(hDlg,IDC_EDIT_GENRE,w_Gener,MAX_PATH); 
	GetDlgItemText(hDlg,IDC_EDIT_DESCRIPTION,w_Desc,MAX_PATH); 


	str_Artist=util.ConvertWCHARToString(w_Artist);
	str_Title=util.ConvertWCHARToString(w_Title);
	str_Album=util.ConvertWCHARToString(w_Album);
	str_Year=util.ConvertWCHARToString(w_Year);
	str_Copyright=util.ConvertWCHARToString(w_Copyright);
	str_Authour=util.ConvertWCHARToString(w_Author);
	str_Gener=util.ConvertWCHARToString(w_Gener);
	str_Desc=util.ConvertWCHARToString(w_Desc);
	
	int int_Year=atoi(str_Year.c_str());	
	_ProtectSet[i++].Exchangedata(index,compare,str_Artist,str_Title,int_Year,str_Album,str_Copyright,str_Authour,str_Gener,str_Desc);		  

}



detail
so once i click on the lisitem view it will call/display other window. for that i saved all that tag in the object respectively filename and index of listview. i have taken static int i for object stored. then when i finished each item with corrsponding itemlist for all tags.
when i context switch in the listview from one lits item to other it couldnt display the respective tags for the particular file. is there any missed thing?


Amit
AnswerRe: How one can update child dialog? Pin
Ravi Bhavnani7-Feb-07 18:18
professionalRavi Bhavnani7-Feb-07 18:18 
GeneralRe: How one can update child dialog? Pin
amitmistry_petlad 7-Feb-07 18:29
amitmistry_petlad 7-Feb-07 18:29 
GeneralRe: How one can update child dialog? Pin
Ravi Bhavnani8-Feb-07 1:44
professionalRavi Bhavnani8-Feb-07 1:44 
GeneralRe: How one can update child dialog? Pin
amitmistry_petlad 8-Feb-07 2:57
amitmistry_petlad 8-Feb-07 2:57 
GeneralRe: How one can update child dialog? Pin
Ravi Bhavnani8-Feb-07 4:04
professionalRavi Bhavnani8-Feb-07 4:04 
Questiondigitalize image Pin
hoa_nguyen7-Feb-07 17:06
hoa_nguyen7-Feb-07 17:06 
AnswerRe: digitalize image Pin
Hamid_RT7-Feb-07 18:20
Hamid_RT7-Feb-07 18:20 
GeneralRe: digitalize image Pin
ThatsAlok7-Feb-07 20:04
ThatsAlok7-Feb-07 20:04 
GeneralRe: digitalize image Pin
Hamid_RT7-Feb-07 20:22
Hamid_RT7-Feb-07 20:22 
GeneralRe: digitalize image Pin
ThatsAlok7-Feb-07 20:37
ThatsAlok7-Feb-07 20:37 
GeneralRe: digitalize image Pin
Hamid_RT7-Feb-07 20:56
Hamid_RT7-Feb-07 20:56 
GeneralRe: digitalize image Pin
hoa_nguyen8-Feb-07 15:49
hoa_nguyen8-Feb-07 15:49 
QuestionHow to access CDialog from an MDI view [modified] Pin
houari_id7-Feb-07 13:54
houari_id7-Feb-07 13:54 
AnswerRe: How to access CDialog from an MDI view Pin
Ravi Bhavnani7-Feb-07 14:21
professionalRavi Bhavnani7-Feb-07 14:21 
GeneralRe: How to access CDialog from an MDI view Pin
houari_id7-Feb-07 14:30
houari_id7-Feb-07 14:30 
GeneralRe: How to access CDialog from an MDI view Pin
Ravi Bhavnani7-Feb-07 14:37
professionalRavi Bhavnani7-Feb-07 14:37 
Questiongetting registry values to my application Pin
arnluci7-Feb-07 13:18
arnluci7-Feb-07 13:18 

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.