Click here to Skip to main content
15,912,507 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: convert to VC++ .net Pin
Vipin.d20-Feb-07 22:00
Vipin.d20-Feb-07 22:00 
GeneralRe: convert to VC++ .net Pin
Hamid_RT21-Feb-07 0:02
Hamid_RT21-Feb-07 0:02 
QuestionHow to send and receive mail in an MFC via Outlook ? Pin
kunal.tawde20-Feb-07 18:11
kunal.tawde20-Feb-07 18:11 
AnswerRe: How to send and receive mail in an MFC via Outlook ? Pin
Nibu babu thomas20-Feb-07 18:22
Nibu babu thomas20-Feb-07 18:22 
AnswerRe: How to send and receive mail in an MFC via Outlook ? Pin
ThatsAlok21-Feb-07 6:07
ThatsAlok21-Feb-07 6:07 
QuestionRegarding USB Pin
Vjys20-Feb-07 17:55
Vjys20-Feb-07 17:55 
AnswerRe: Regarding USB Pin
Nibu babu thomas20-Feb-07 19:20
Nibu babu thomas20-Feb-07 19:20 
QuestionImageList_Create,ImageList_AddIcon,ListView_SetImageList gives linking error Pin
amitmistry_petlad 20-Feb-07 17:34
amitmistry_petlad 20-Feb-07 17:34 
i have added #include <commctrl.h> .inspite of ImageList_Create,ImageList_AddIcon,ListView_SetImageList gives linking error.
The commented red code is not supported,

#include <commctrl.h>

the code is following.
case WM_INITDIALOG:	
		{		int i;
				char Temp[255];
				char * buff = new char[5000];
				string xmlbuffer,Pathforfile,PATH;
				Registry objReg;
				ifstream in;
				Utility util;
			    	hList=GetDlgItem(hDlg,IDC_LIST4); // get the ID of the ListView	                	memset(&LvCol,0,sizeof(LvCol)); // Reset Coluom	
	/////////////////ADDING FOR IMAGE
				HIMAGELIST hSmall;
				HICON hIcon;
<code>				
// Create the ImageList
				// hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), ILC_COLOR32|ILC_MASK, 1, 1);
				
				//hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_QUESTION));
			 	// ImageList_AddIcon(hSmall, hIcon);
				// Assign ImageList to List View
			 	// ListView_SetImageList(hList, hSmall, LVSIL_SMALL);
			</code>

	// Create columns for our List View
				
				LvCol.mask      =LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;			
				LvCol.iSubItem	= 0;
				LvCol.pszText	= _T("Image");				
				LvCol.cx=0x58;
				ListView_InsertColumn(hList, 0, &LvCol);					
				
				LvCol.pszText=_T("File");                     // First Header
				SendMessage(hList,LVM_INSERTCOLUMN,1,(LPARAM)&LvCol);
				LvCol.pszText=_T("Extension");
				SendMessage(hList,LVM_INSERTCOLUMN,2,(LPARAM)&LvCol); 	 // Insert/Show the coloum
				                          				// Next coloum
				LvCol.pszText=_T("Location");                          // Next coloum
				SendMessage(hList,LVM_INSERTCOLUMN,3,(LPARAM)&LvCol); // Insert/Show the coloum
				
				LvCol.pszText=_T("Size");                       
		                SendMessage(hList,LVM_INSERTCOLUMN,4,(LPARAM)&LvCol); 			
				
				LvCol.pszText=_T("Duration");                              
		                SendMessage(hList,LVM_INSERTCOLUMN,5,(LPARAM)&LvCol); 
				LvCol.pszText=_T("Bit Rate");                            
                		SendMessage(hList,LVM_INSERTCOLUMN,6,(LPARAM)&LvCol); 
				LvCol.pszText=_T("Type");       
		                SendMessage(hList,LVM_INSERTCOLUMN,7,(LPARAM)&LvCol); 
				LvCol.pszText=_T("Modified Date");               
                		SendMessage(hList,LVM_INSERTCOLUMN,8,(LPARAM)&LvCol); 
				LvCol.pszText=_T("Progress");                      
		                SendMessage(hList,LVM_INSERTCOLUMN,9,(LPARAM)&LvCol); 
				LvCol.pszText=_T("Protected");
                		SendMessage(hList,LVM_INSERTCOLUMN,10,(LPARAM)&LvCol);
				                      
                
                		memset(&LvItem,0,sizeof(LvItem)); // Reset Item Struct				
				//  Setting properties Of Items:
				LvItem.mask=LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; // Text Style
				LvItem.cchTextMax = 256; // Max size of test
		                ListView_SetItemState(hList,0,LVIS_SELECTED	,LVIF_STATE);				
				
				Pathforfile = objReg.GetRegistryKeyEntryValue(TEXT("SOFTWARE\\DRM"),TEXT("InstallDIR"));
				PATH=Pathforfile+"Encoder"+username+SITE_ID+".xml";				
				in.open((PATH.c_str()), ios::in);
				char str[2000];
				string outstring;
				WCHAR w_UploadedFile[MAX_PATH];
				bool onoff=in.is_open();
				if(onoff)
				{		
					
					while(in >> str)
					  outstring+=str; //file has read in the  outstring 

					
					char *token;
					char *tok = strtok_s((char*)outstring.c_str(),"<>",&token);					
					while(tok)
					{
					if(tok == NULL)
						break;
					else
						{
						string tmp = tok;
						// Check for the <Profile> Node.
						if(tmp.find("type") != -1)
						{	
				   //Get the profile Name and store in the vector;
								{
									size_t pos1 = tmp.find_first_of("=");
									if(pos1 != -1)
									{
										string tmpType = tmp.substr(pos1 + 2);			
										size_t pos2 = tmpType.find_first_of("\"");
										if(pos2 != -1)
										{
										string inputtype = tmpType.substr(0,pos2);					
										if(inputtype=="dir")
										{
											if(tmp.find("order") != -1)
												{
													size_t pos1 = tmp.find_last_of("=");
													string tmporder = tmp.substr(pos1 + 2);
													size_t pos2 = tmporder.find_last_of("\"");
													string inputorder = tmporder.substr(0,pos2);
													int i=atoi(inputorder.c_str());												
													tok = strtok_s(NULL,"<>",&token);													
													tmp=tok;
													if(tmp.find("path") != -1)
													{													
														tok = strtok_s(NULL,"<>",&token);														
														string filename=tok;
												WCHAR* IRPATH=util.ConvertStringToWCHAR(filename.c_str());						MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,filename.c_str(),(int)(filename.length() + 1),w_UploadedFile,MAX_PATH);
													LvItem.iItem=i;
													LvItem.iSubItem=0;
													<big>LvItem.iImage = 0;// 0th image in the image list
													LvItem.mask = LVIF_TEXT|LVIF_IMAGE;
												LvItem.pszText=(LPWSTR)w_UploadedFile;													</big>			SendMessage(hList,LVM_INSERTITEM,0,(LPARAM)&LvItem);
													}

													tok = strtok_s(NULL,"<>",&token);
													tok = strtok_s(NULL,"<>",&token);
											        tmp=tok;
													if(tmp.find("Protected")!=-1)
													{
														tok=strtok_s(NULL,"<>",&token);
														WCHAR* protec=util.ConvertStringToWCHAR(tok);
														LvItem.pszText=(LPWSTR)protec;
														LvItem.iSubItem=8;

														SendMessage(hList,LVM_SETITEM,0,(LPARAM)&LvItem);
													}
																								}

									}else if(inputtype=="file")
										{							
											int j=0;
											if(tmp.find("order") != -1)
											{
												size_t pos1 = tmp.find_last_of("=");
												string tmporder = tmp.substr(pos1 + 2);
												size_t pos2 = tmporder.find_last_of("\"");
												string inputorder = tmporder.substr(0,pos2);
												int i=atoi(inputorder.c_str());	

												tok = strtok_s(NULL,"<>",&token);													
												tmp=tok;
													if(tmp.find("filename") != -1)
													{													
													tok = strtok_s(NULL,"<>",&token);														
													string filename=tok;
													WCHAR* DIRPATH=util.ConvertStringToWCHAR(tok);
																							MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,filename.c_str(),(int)(filename.length() + 1),w_UploadedFile,MAX_PATH);
																										}
													LvItem.iItem=i;            // choose item  
													<big>LvItem.iSubItem=0;
													LvItem.iImage = 0;// 0th image in the image list
													LvItem.mask = LVIF_TEXT|LVIF_IMAGE;
													LvItem.pszText=(LPWSTR)w_UploadedFile;
													SendMessage(hList,LVM_INSERTITEM,0,(LPARAM)&LvItem);		   
												
			</big>										 for(j=1;j<=8;j++)
													{
													  tok = strtok_s(NULL,"<>",&token);
													  tok = strtok_s(NULL,"<>",&token);
													  tok = strtok_s(NULL,"<>",&token);
													   
													  if(j==7)
													  {
													  string filename=tok;
													  if(filename=="P")
													  filename=" ";
													  WCHAR* DIRPATH=util.ConvertStringToWCHAR(filename.c_str());
													  LvItem.pszText=(LPWSTR)DIRPATH;
													  }else
													  {
													  WCHAR* DIRPATH=util.ConvertStringToWCHAR(tok);
													  LvItem.pszText=(LPWSTR)DIRPATH;
													  }
													  LvItem.iSubItem=j;         
													  SendMessage(hList,LVM_SETITEM,0,(LPARAM)&LvItem);													  
													 }
													
											   }

											}			
										}
									}								
								}
							
							}
							
						}						
					
					tok = strtok_s(NULL,"<>",&token);		
					}					
				}
				in.close();				
 		  //DeleteFile(mainfilenameXML); //////////////////////////end add by amit
		}
		break;

AnswerRe: ImageList_Create,ImageList_AddIcon,ListView_SetImageList gives linking error Pin
Hamid_RT20-Feb-07 17:38
Hamid_RT20-Feb-07 17:38 
AnswerRe: ImageList_Create,ImageList_AddIcon,ListView_SetImageList gives linking error Pin
prasad_som20-Feb-07 18:07
prasad_som20-Feb-07 18:07 
GeneralRe: ImageList_Create,ImageList_AddIcon,ListView_SetImageList gives linking error [modified] Pin
amitmistry_petlad 20-Feb-07 19:30
amitmistry_petlad 20-Feb-07 19:30 
QuestionControlling Move Speed Pin
T.RATHA KRISHNAN20-Feb-07 17:32
T.RATHA KRISHNAN20-Feb-07 17:32 
AnswerRe: Controlling Move Speed Pin
Stephen Hewitt20-Feb-07 19:00
Stephen Hewitt20-Feb-07 19:00 
GeneralRe: Controlling Move Speed Pin
T.RATHA KRISHNAN20-Feb-07 19:17
T.RATHA KRISHNAN20-Feb-07 19:17 
GeneralRe: Controlling Move Speed Pin
Stephen Hewitt20-Feb-07 19:21
Stephen Hewitt20-Feb-07 19:21 
GeneralRe: Controlling Move Speed Pin
T.RATHA KRISHNAN20-Feb-07 19:36
T.RATHA KRISHNAN20-Feb-07 19:36 
GeneralRe: Controlling Move Speed Pin
Stephen Hewitt20-Feb-07 19:41
Stephen Hewitt20-Feb-07 19:41 
GeneralRe: Controlling Move Speed Pin
T.RATHA KRISHNAN20-Feb-07 23:36
T.RATHA KRISHNAN20-Feb-07 23:36 
QuestionHow do we add vertical scroll bar for dialog based application? Pin
Super Hornet20-Feb-07 16:13
Super Hornet20-Feb-07 16:13 
AnswerRe: How do we add vertical scroll bar for dialog based application? Pin
Nibu babu thomas20-Feb-07 17:32
Nibu babu thomas20-Feb-07 17:32 
AnswerRe: How do we add vertical scroll bar for dialog based application? Pin
Hamid_RT20-Feb-07 17:33
Hamid_RT20-Feb-07 17:33 
QuestionDetect color Using C++ Pin
ricardo montemayor20-Feb-07 14:21
ricardo montemayor20-Feb-07 14:21 
AnswerRe: Detect color Using C++ Pin
Hamid_RT20-Feb-07 17:35
Hamid_RT20-Feb-07 17:35 
GeneralRe: Detect color Using C++ Pin
prasad_som20-Feb-07 18:08
prasad_som20-Feb-07 18:08 
AnswerRe: Detect color Using C++ Pin
Stephen Hewitt20-Feb-07 19:24
Stephen Hewitt20-Feb-07 19:24 

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.