 |
|
 |
I am utilizing the current version on this class and it works great for my application.
Is there a version of this that can be used in a win32 console application or a win32 application?
It's work like yours that makes using and learning how to program so much more easy. It just makes life much easier than trying to re-invent the wheel! Thanks for the code and hope you can help with my Console or win32 application!
Thanks,
Charlie
Everything is Free... Until You Have to Pay for it...
Platforms Windows 2000/XP Professional using Visual C++ 6.0 Visual Studio 2005
|
|
|
|
 |
|
 |
there's no reason this can't work in a console app, provided that app uses MFC. for a Win32 app, or if you're not using MFC, you'll need to replace things like CString with the std:: equivalents.
|
|
|
|
 |
|
 |
Wow thanks for the super fast response! Don't suppose you could point to some code that would get me started? Anyway thanks for the info!
Charlie
Everything is Free... Until You Have to Pay for it...
Platforms Windows 2000/XP Professional using Visual C++ 6.0 Visual Studio 2005
|
|
|
|
 |
|
 |
hey Chris,
I need to use your classes with my USB Automatic File Syncing Application (with a remote host).
I am having difficulties in reading the source directory in the USB drive with those functions provided along with a FTP client library I am using as FTPWebRequest object need path starting with "/" which is a norm for specifying source directory in FTPs.
I really feel your application can help me...so that I can monitor my USB drive contents and populate the Lists with file and directory names in it.
And later on I just need to set the Upload filenames to Upload my files on the server.
I am working on C#.NET so can you provide me the source of your application in C# or any significant guidance would be highly appreciable.
NITIN
|
|
|
|
 |
|
 |
Hi, it appears that VC8 does not like your code. When I tried to build, I got all sorts of errors. I’m sorry for barrage below, but it doesn’t seem I can attach the log as a file.
Build Log
Build started: Project: HDSearcher, Configuration: Debug|Win32
Command Lines
Creating temporary file "k:\My Documents\HomeDirectories Project\HDSearcher\HDSearcher\Debug\RSP00000411084876.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP ".\Main.cpp"
".\SADirRead.cpp"
]
Creating command line "cl.exe @"k:\My Documents\HomeDirectories Project\HDSearcher\HDSearcher\Debug\RSP00000411084876.rsp" /nologo /errorReport:prompt"
Output Window
Compiling...
SADirRead.cpp
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(127) : error C2059: syntax error : ''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(127) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(131) : error C2146: syntax error : missing ';' before identifier 'm_sName'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(131) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(131) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(144) : error C2146: syntax error : missing ';' before identifier 'm_sName'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(144) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(144) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(174) : error C2143: syntax error : missing ',' before '&'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : error C2146: syntax error : missing ';' before identifier 'FindFiles'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : error C2143: syntax error : missing ',' before '&'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : warning C4183: 'FindFiles': missing return type; assumed to be a member function returning 'int'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(176) : error C2061: syntax error : identifier 'CString'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(178) : error C2146: syntax error : missing ';' before identifier 'm_sSourceDir'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(178) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(178) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(128) : error C2065: 'm_sSourceDir' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(146) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(146) : error C2143: syntax error : missing ',' before '&'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(148) : error C2146: syntax error : missing ';' before identifier 'newPath'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(148) : error C2065: 'newPath' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(150) : error C2146: syntax error : missing ';' before identifier 'searchString'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(150) : error C2065: 'searchString' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(151) : error C2065: 'path' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(199) : error C2065: 'WIN32_FIND_DATA' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(199) : error C2146: syntax error : missing ';' before identifier 'FindFileData'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(199) : error C2065: 'FindFileData' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(200) : error C2065: 'HANDLE' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(200) : error C2146: syntax error : missing ';' before identifier 'hFind'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(200) : error C2065: 'hFind' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(201) : error C2065: 'INVALID_HANDLE_VALUE' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(201) : error C3861: 'FindFirstFile': identifier not found
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(204) : error C2228: left of '.dwFileAttributes' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(204) : error C2065: 'FILE_ATTRIBUTE_DIRECTORY' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(207) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(207) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(211) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(219) : error C3861: 'FindNextFile': identifier not found
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(222) : error C2228: left of '.dwFileAttributes' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(225) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(225) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(229) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(238) : error C3861: 'FindClose': identifier not found
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(272) : error C2065: 'CString' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(272) : error C2146: syntax error : missing ';' before identifier 'curDir'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(272) : error C2065: 'curDir' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(272) : error C2039: 'm_sName' : is not a member of 'CSADirRead::CSADirEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(125) : see declaration of 'CSADirRead::CSADirEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(275) : error C2228: left of '.IsEmpty' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(315) : error C2448: 'CSADirRead::FormatPath' : function-style initializer appears to be a function definition
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(339) : error C2143: syntax error : missing ';' before 'CSADirRead::FindFiles'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(339) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(339) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(339) : error C2143: syntax error : missing ',' before '&'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(340) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(342) : error C2146: syntax error : missing ';' before identifier 'baseName'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(342) : error C2065: 'baseName' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(342) : error C2065: 'dir' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(346) : error C2146: syntax error : missing ';' before identifier 'fullPath'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(346) : error C2065: 'fullPath' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(347) : error C2065: 'filter' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(349) : error C2146: syntax error : missing ';' before identifier 'fileName'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(349) : error C2065: 'fileName' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(420) : error C2146: syntax error : missing ';' before identifier 'FindFileData'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(421) : error C2146: syntax error : missing ';' before identifier 'hFind'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(424) : error C3861: 'FindFirstFile': identifier not found
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(426) : error C2228: left of '.dwFileAttributes' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(428) : error C2065: 'bIncludeFoldersInFileList' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(428) : error C2065: 'bIncludeFilesInFileList' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(431) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(431) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(439) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(442) : error C2039: 'm_sName' : is not a member of 'CSADirRead::CSAFileEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(143) : see declaration of 'CSADirRead::CSAFileEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(445) : error C2228: left of '.dwFileAttributes' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(447) : error C2228: left of '.ftLastWriteTime' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(447) : error C2065: '_FILETIME' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(447) : error C2070: ''unknown-type'': illegal sizeof operand
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(447) : error C3861: 'ASSERT': identifier not found
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(448) : error C2228: left of '.ftLastWriteTime' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(448) : error C2070: ''unknown-type'': illegal sizeof operand
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(450) : error C2228: left of '.ftLastWriteTime' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(450) : error C2070: ''unknown-type'': illegal sizeof operand
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(450) : error C3861: 'ASSERT': identifier not found
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(451) : error C2228: left of '.ftCreationTime' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(451) : error C2070: ''unknown-type'': illegal sizeof operand
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(453) : error C2228: left of '.nFileSizeHigh' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(453) : error C2065: 'MAXDWORD' : undeclared identifier
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(453) : error C2228: left of '.nFileSizeLow' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(458) : error C3861: 'FindNextFile': identifier not found
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(460) : error C2228: left of '.dwFileAttributes' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(465) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(465) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(473) : error C2228: left of '.cFileName' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(476) : error C2039: 'm_sName' : is not a member of 'CSADirRead::CSAFileEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(143) : see declaration of 'CSADirRead::CSAFileEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(479) : error C2228: left of '.dwFileAttributes' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(481) : error C2228: left of '.ftLastWriteTime' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(481) : error C2070: ''unknown-type'': illegal sizeof operand
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(481) : error C3861: 'ASSERT': identifier not found
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(482) : error C2228: left of '.ftLastWriteTime' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(482) : error C2070: ''unknown-type'': illegal sizeof operand
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(484) : error C2228: left of '.ftLastWriteTime' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(484) : error C2070: ''unknown-type'': illegal sizeof operand
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(484) : error C3861: 'ASSERT': identifier not found
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(485) : error C2228: left of '.ftCreationTime' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(485) : error C2070: ''unknown-type'': illegal sizeof operand
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(487) : error C2228: left of '.nFileSizeHigh' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(487) : error C2228: left of '.nFileSizeLow' must have class/struct/union
type is ''unknown-type''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(491) : error C3861: 'FindClose': identifier not found
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(507) : error C2039: 'm_sName' : is not a member of 'CSADirRead::CSADirEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(125) : see declaration of 'CSADirRead::CSADirEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(507) : error C2039: 'm_sName' : is not a member of 'CSADirRead::CSADirEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(125) : see declaration of 'CSADirRead::CSADirEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(514) : error C2039: 'm_sName' : is not a member of 'CSADirRead::CSAFileEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(143) : see declaration of 'CSADirRead::CSAFileEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.cpp(514) : error C2039: 'm_sName' : is not a member of 'CSADirRead::CSAFileEntry'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(143) : see declaration of 'CSADirRead::CSAFileEntry'
Main.cpp
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(127) : error C2059: syntax error : ''
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(127) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(131) : error C2146: syntax error : missing ';' before identifier 'm_sName'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(131) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(131) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(144) : error C2146: syntax error : missing ';' before identifier 'm_sName'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(144) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(144) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(174) : error C2143: syntax error : missing ',' before '&'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : error C2146: syntax error : missing ';' before identifier 'FindFiles'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : error C2143: syntax error : missing ',' before '&'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(175) : warning C4183: 'FindFiles': missing return type; assumed to be a member function returning 'int'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(176) : error C2061: syntax error : identifier 'CString'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(178) : error C2146: syntax error : missing ';' before identifier 'm_sSourceDir'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(178) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\sadirread.h(178) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
k:\my documents\homedirectories project\hdsearcher\hdsearcher\main.cpp(7) : error C2059: syntax error : '...'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\main.cpp(8) : error C2143: syntax error : missing ';' before '{'
k:\my documents\homedirectories project\hdsearcher\hdsearcher\main.cpp(8) : error C2447: '{' : missing function header (old-style formal list?)
k:\my documents\homedirectories project\hdsearcher\hdsearcher\main.cpp(29) : fatal error C1004: unexpected end-of-file found
Generating Code...
Results
Build log was saved at "file://k:\My Documents\HomeDirectories Project\HDSearcher\HDSearcher\Debug\BuildLog.htm"
HDSearcher - 137 error(s), 2 warning(s)
I am new to coding, so this could easily be all my fault, but if it is, can you help me fix it?
|
|
|
|
 |
|
 |
it looks like the compiler is missing all the standard Windows and MFC types.
are you putting this in an MFC app ? (you need to)
|
|
|
|
 |
|
 |
I’m using Visual C++ 2005 Express Edition with Service Pack 1. (This is the first program/script I’ve need to do since coming here and they don’t have a copy of Visual Studio for me to use.) The place I work for wanted me to write a script to look though our user directory tree and created an entry for each second-level folder. Your code looked like perfect match. I did some coding in C++ back in college, but it’s been a while and at that point we wrote all of the code ourselves and the programs were very simple. I looked for a project type that contained MFC in the name, but I could not find one. The project type the errors were generated in was a Win32 Console Application. Should I be using a different project type?
|
|
|
|
 |
|
 |
ah. MFC isn't included with VS05 Express.
but, the basics of directory spanning are pretty simple: take a look at the MSDN for the FindFirstFile and FindNextFile functions. those functions (or their equivalents) are at the heart of my class.
|
|
|
|
 |
|
 |
HI chris,
thnx for such a gr8 class. well i hav to use it in a simple win32 application without any MFC. The system(win2k,9x,XP), where my application will be deployed, doesnt hav any MFC dll installed. As ur class uses CString which is MFC class, will it work in my scenario. plz help me in this regard.
hye plz reply soon as possible...
thnx
|
|
|
|
 |
|
 |
you could try replacing CString with something like this class^.
|
|
|
|
 |
|
 |
thnx chris, i hav to check the incompatibilities of CString n this new class, but it seems there r not many...
|
|
|
|
 |
|
 |
Hi, I downloaded the code and it is working fine. When I integrated it into my program, i got this error. (I have copied, SADirRead.cpp and the .h) filelistDlg.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CSADirRead::~CSADirRead(void)" (??1CSADirRead@@UAE@XZ) filelistDlg.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CSADirRead::ClearFiles(void)" (?ClearFiles@CSADirRead@@QAE_NXZ) filelistDlg.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CSADirRead::SortFiles(int,bool)" (?SortFiles@CSADirRead@@QAE_NH_N@Z) filelistDlg.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CSADirRead::GetFiles(char const *,bool,bool)" (?GetFiles@CSADirRead@@QAE_NPBD_N1@Z) filelistDlg.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CSADirRead::GetDirs(char const *,bool)" (?GetDirs@CSADirRead@@QAE_NPBD_N@Z)
Basically it is telling this "<return type>__thiscall CSADirRead::<function prototype>" (?<function name@CSADirRead@@<some characters>)
Please help me. Thank you Mukund
|
|
|
|
 |
|
|
 |
|
 |
Yes I did. these were those files SADirRead.cpp SADirRead.h Mukund
|
|
|
|
 |
|
|
 |
|
 |
How to resolve with this problem?
I'm using vietnammese file name, and this program has not true unicode file name!
|
|
|
|
 |
|
 |
I don't know where you found %u64 S/B %lu
Old dog learning new tricks!
|
|
|
|
 |
|
 |
when i get the file path by (*fit).m_sName, the path is fullpath
is possible to get the relative path ?
for example, if the current directory of the process is c:\temp which contain a sub directory c:\temp\subtemp
i found i can pass the relative path like this:
dr.GetDirs("subtemp", true);
but the filepath from (*fit).m_sName is like
"c:\temp\subtemp\a.txt"
and i just want "subtemp\a.txt"
how can i get this result ?
thx
|
|
|
|
 |
|
 |
you'll have to figure out the relative path yourself. but, it's a fairly simple string parsing process. something like this:
To: c:\foo\file.txt
From: c:\foo\subdir\file2.txt
remove the parts of the path that match:
To: \file.txt
From: \subdir\file2.txt
then, for each folder name in From, add ".." to the start of To:
..\file.txt
Cleek | Losinger Designs | ClickPic | ThumbNailer
|
|
|
|
 |
|
 |
Hi, thanks for the cool code mate, I can't seem to get it to work in mine though. Here are the compiler errors I get Compiling... main.cpp C:\Matthew_W\SADirRead.h(127) : error C2629: unexpected 'struct CSADirRead::CSADirEntry (' C:\Matthew_W\SADirRead.h(127) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body C:\Matthew_W\SADirRead.h(131) : error C2146: syntax error : missing ';' before identifier 'm_sName' C:\Matthew_W\SADirRead.h(131) : error C2501: 'CString' : missing storage-class or type specifiers C:\Matthew_W\SADirRead.h(131) : error C2501: 'm_sName' : missing storage-class or type specifiers C:\Matthew_W\SADirRead.h(144) : error C2146: syntax error : missing ';' before identifier 'm_sName' C:\Matthew_W\SADirRead.h(144) : error C2501: 'CString' : missing storage-class or type specifiers C:\Matthew_W\SADirRead.h(144) : error C2501: 'm_sName' : missing storage-class or type specifiers C:\Matthew_W\SADirRead.h(174) : error C2143: syntax error : missing ',' before '&' C:\Matthew_W\SADirRead.h(174) : error C2059: syntax error : '&' C:\Matthew_W\SADirRead.h(175) : error C2146: syntax error : missing ';' before identifier 'FindFiles' C:\Matthew_W\SADirRead.h(175) : error C2501: 'UINT' : missing storage-class or type specifiers C:\Matthew_W\SADirRead.h(175) : error C2143: syntax error : missing ',' before '&' C:\Matthew_W\SADirRead.h(175) : error C2059: syntax error : '&' C:\Matthew_W\SADirRead.h(176) : error C2061: syntax error : identifier 'CString' C:\Matthew_W\SADirRead.h(178) : error C2146: syntax error : missing ';' before identifier 'm_sSourceDir' C:\Matthew_W\SADirRead.h(178) : error C2501: 'CString' : missing storage-class or type specifiers C:\Matthew_W\SADirRead.h(178) : error C2501: 'm_sSourceDir' : missing storage-class or type specifiers C:\Matthew_W\main.cpp(113) : error C2039: 'm_sName' : is not a member of 'CSAFileEntry' C:\Matthew_W\SADirRead.h(143) : see declaration of 'CSAFileEntry' Error executing cl.exe. Creating browse info file... hrugen.exe - 19 error(s), 0 warning(s)
|
|
|
|
 |
|
 |
I think I've narrowed it down to my program not being an mfc type program (feel free to correct me if I'm way off track here). Any way I can use this code in a non-mfc program...I'll keep rying
|
|
|
|
 |
|
 |
I have yhe same probleme
I hope, if you result the pb, sent it to forum
|
|
|
|
 |
|
 |
Hi,
i have got problems with the SADirRead Class. Which files from the example do i need ? Which Changes have to be done by me in the rest of the project ?
When i tryed to integrate the class i often got the error message:
SADirRead.h(127) : error C2226: Syntaxerror: Typ 'CSADirRead::CSADirEntry' not expected
I would be glad to get some advise.
Stephan
|
|
|
|
 |
|
|
 |
|
 |
First i have not - but it did not compile... which files do i need to include ? First i took SADirRead.h and SADirRead.cpp but in the SADirRead.cpp file dir.h is also included... I have only the example files - perhaps there is also a possiblility to get only the sources which are different ?!?
|
|
|
|
 |