Click here to Skip to main content
15,922,325 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Copy USB Device Data To System Pin
Cedric Moonen20-Aug-08 21:54
Cedric Moonen20-Aug-08 21:54 
GeneralRe: Copy USB Device Data To System Pin
NewVC++20-Aug-08 22:05
NewVC++20-Aug-08 22:05 
GeneralRe: Copy USB Device Data To System Pin
Cedric Moonen20-Aug-08 22:11
Cedric Moonen20-Aug-08 22:11 
GeneralRe: Copy USB Device Data To System Pin
NewVC++20-Aug-08 22:21
NewVC++20-Aug-08 22:21 
GeneralRe: Copy USB Device Data To System Pin
Cedric Moonen20-Aug-08 22:27
Cedric Moonen20-Aug-08 22:27 
GeneralRe: Copy USB Device Data To System Pin
SandipG 20-Aug-08 22:23
SandipG 20-Aug-08 22:23 
AnswerRe: Copy USB Device Data To System Pin
User 21559720-Aug-08 23:01
User 21559720-Aug-08 23:01 
QuestionDummy Line Pin
NewVC++20-Aug-08 20:31
NewVC++20-Aug-08 20:31 
Hi All

I have a problem to Show USB Drive Name and File name.Problen is that when i insert a USB device then Drive Name and file name is show but also show Some dummy line like this
"ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌA".
I debug the code.When i change the this line
char chDriveLabel='A'; to char chDriveLabel='B';
then it is working fine.But when i change this line then i have found some problem like when i insert the
first usb device
then nothing show and when i insert
more than i device
then it is showing.So Plz help me code is here
BOOL CUSBDlg::FileList()
{							
	
	

          //Get Logical Drives

          DWORD dwDrives=GetLogicalDrives();

 

          if(0==dwDrives)

          {

                  return FALSE;

          }

 

          DWORD dwCount=0;

 

          char chDriveLabel='A';

 

          char szRootpath[5]={0,0,0,0,0};

 

          while(dwDrives !=0)

          {

                   if ((dwDrives & 1) != 0)

                   {

                             sprintf(szRootpath,"%c:\\",chDriveLabel);

 

                             //removable drive

                             if(DRIVE_REMOVABLE==GetDriveType(szRootpath))

                             {

                                      WIN32_FIND_DATA FindFileData;

                                      HANDLE hFind;

 

                                      //Removable dirve lable

                                 //   std::cout <<"Files in " << szRootpath << std::endl;

									
									
									 m_ListCountries.AddString(szRootpath);
									 	//  AfxMessageBox(szRootpath);

									 m_tree.InsertItem(szRootpath);

									 
									 
                                      //* represent search all files and directories

                                      szRootpath[3]='*';

 

                                      hFind=FindFirstFile(szRootpath,&FindFileData);

 

                                      if (INVALID_HANDLE_VALUE == hFind) 

                                      {

                                        //       return FALSE;

                                      } 

 
   
									 
                                      // List all the files in the directory .

                                      do

                                      {
											

                                                //ignore the sub directories

                                               if (strcmp(FindFileData.cFileName,_T(".")) && strcmp(FindFileData.cFileName,_T(".."))) 

                                                {
													
														 m_ListCountries.AddString(FindFileData.cFileName);
														//  AfxMessageBox(FindFileData.cFileName);
													 m_tree.InsertItem(FindFileData.cFileName);

                                                }

											   AfxMessageBox("helloP");

											   AfxMessageBox(FindFileData.cFileName);

											

                                      }while (FindNextFile(hFind, &FindFileData) != 0);

 

                                      FindClose(hFind);

                             }

 

                   }

                   dwDrives = dwDrives >> 1;//next drive

                   chDriveLabel++;

          }
		 
		  return true;

}

QuestionRepost. Pin
CPallini20-Aug-08 22:08
mveCPallini20-Aug-08 22:08 
AnswerRe: Repost. Pin
NewVC++20-Aug-08 22:28
NewVC++20-Aug-08 22:28 
GeneralRe: Repost. Pin
CPallini20-Aug-08 22:36
mveCPallini20-Aug-08 22:36 
GeneralRe: Repost. Pin
NewVC++20-Aug-08 23:47
NewVC++20-Aug-08 23:47 
GeneralRe: Repost. Pin
toxcct20-Aug-08 23:52
toxcct20-Aug-08 23:52 
GeneralRe: Repost. Pin
CPallini20-Aug-08 23:56
mveCPallini20-Aug-08 23:56 
QuestionRe: Repost. Pin
David Crow21-Aug-08 3:35
David Crow21-Aug-08 3:35 
AnswerRe: Repost. Pin
NewVC++21-Aug-08 18:19
NewVC++21-Aug-08 18:19 
GeneralRe: Repost. Pin
David Crow22-Aug-08 8:09
David Crow22-Aug-08 8:09 
QuestionWhat Functions are called Pin
Taruni20-Aug-08 20:05
Taruni20-Aug-08 20:05 
AnswerRe: What Functions are called Pin
Hamid_RT20-Aug-08 20:24
Hamid_RT20-Aug-08 20:24 
GeneralRe: What Functions are called Pin
Taruni20-Aug-08 20:57
Taruni20-Aug-08 20:57 
GeneralRe: What Functions are called Pin
toxcct20-Aug-08 21:16
toxcct20-Aug-08 21:16 
AnswerRe: What Functions are called Pin
Rajesh R Subramanian20-Aug-08 20:26
professionalRajesh R Subramanian20-Aug-08 20:26 
AnswerRe: What Functions are called Pin
Naveen20-Aug-08 22:20
Naveen20-Aug-08 22:20 
AnswerRe: What Functions are called Pin
SRKSHOME20-Aug-08 23:45
SRKSHOME20-Aug-08 23:45 
JokeRe: What Functions are called Pin
toxcct21-Aug-08 0:05
toxcct21-Aug-08 0:05 

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.