|
from http://www.codeproject.com/file/sadirread.asp
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
if ((hFind = FindFirstFile(fullPath, &FindFileData))!=INVALID_HANDLE_VALUE)
{
if ((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)!=FILE_ATTRIBUTE_DIRECTORY)
{
size = ((unsigned __int64)FindFileData.nFileSizeHigh * ((unsigned __int64)MAXDWORD+1)) + (unsigned __int64)FindFileData.nFileSizeLow;
}
}
and, of course the FindNextFile loop comes right below this.
-c
Cheap oil. It's worth it!
|
|
|
|
|
Is the Following better?
int nSize;
CFileFind finder;
CString FileType("*.TYP");
finder.FindFile(FileType)
while(Found)
{
Found = finder.FindNextFile();
if(finder.IsDots() || finder.IsDirectory())
continue;
nSize = finder.GetLength();
}
Cheers
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
not if the original poster wants to use FindNextFile, not CFileFinder.
-c
Cheap oil. It's worth it!
|
|
|
|
|
Chris.
Yes is true...
The original message doesn't specify if he wants to use CFindFile::FindNextFile or ::FindNextFile...
You have the true, I don't why but always I think in MFC...
Regards....
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
and i always think in standard C. i originally did this with _findfirst, _findnext. i didn't even know there was a CFindFile class.
-c
Cheap oil. It's worth it!
|
|
|
|
|
Hi all ,
outside of OnPaint()I call in other function CDc* pDc = GetDc().
Sometimes its returns NULL.
Why?????????
Aizik Yair
Software Engineer
|
|
|
|
|
I found the reason.
I need call ReleaseDc() each time i use GetDC()
Aizik Yair
Software Engineer
|
|
|
|
|
I have changed some the default menu settings in my app, but now the Exit button does not work. I did remap it but thats because I wanted to do some cleaning up before it exited.
I thought the default behaviour was to map to WinApp::ExitInstance but that doesn't work.
does anyone know the default Exit function which VisC++ automatically maps the Exit button to.
cheers
Asim.
.........
I'd rather be rich than stupid.
|
|
|
|
|
The default exit process is triggered by sending WM_CLOSE to the main frame window (this is what CWinApp:OnExitApp does.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
AfxGetMainWnd()->PostMessage(WM_CLOSE);
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hi All
As a newbie in C++, particularly in MFC, i'm strggling about how to pass the 2 dimensional array as parameter by reference and manipulate it through a void method. I want to pass a 4x4 two dimensional array to a method which the implementation looks like this:
void Group::GetResults(int& res[4][4])
{
for(int i = 0 ; i < 4; i++)
{
res[i][i] = result[i][i];
}
}
as you can see i want to change the values of the 2 dimensional array passed in to a local 2 dimensional array in the local class which is the result
And this is how i use it in the view class:
int tempArray[4][4]
GetResult(tempArray)
thanks for reading this.
Regard
|
|
|
|
|
You can pass int** like this
void Group::GetResults (int** a, int n )
{
for (int i = 0; i < n; i++)
{
res[i][i] = result[i][i];
}
}
and then use it like this:
int a[4][4];
GetResult (a);
Best regards,
Alexandru Savescu
|
|
|
|
|
hi alex
i did the way that u guided me but this is the error that i got
E:\Documents and Settings\Administrator\My Documents\ST2\Assignment3\ass3_q1\ass3_q1View.cpp(319) : error C2664: 'GetResults' : cannot convert parameter 1 from 'int (*)[4][4]' to 'int ** '
any idea??
Cheers
|
|
|
|
|
It compiles fine on my computer, send me a sample and I'll tell you what is wrong.
Best regards,
Alexandru Savescu
|
|
|
|
|
Actually it doesn't
Take Joaquin advice!
Best regards,
Alexandru Savescu
|
|
|
|
|
void Group::GetResults(int res[][4])
{
...
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
it gives me error this way too!
Is that how you pass 2 dimensionals array??
|
|
|
|
|
I'm pretty much sure it works, cause I've tried it. Maybe you could post your code to see the differences.
PS. Do you have an extra & in the argument?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
ok here it comes
pDoc->A.GetResults(result[][4]);
and this is my implementation:
void Group::GetResults(int res[][4])
{
for(int i = 0 ; i < 4; i++)
{
res[i][i] = result[i][i];
}
}
Thanks
|
|
|
|
|
and this is error i get
E:\Documents and Settings\Administrator\My Documents\ST2\Assignment3\ass3_q1\ass3_q1View.cpp(319) : error C2059: syntax error : ']'
Thanks
|
|
|
|
|
You should call it like this: pDoc->A.GetResults (result);
Best regards,
Alexandru Savescu
Best regards,
Alexandru Savescu
|
|
|
|
|
oh, that's right! I didn't notice that, probaly after a busy day . Thanks alot for your help Alex and Joan.
Best Regard
|
|
|
|
|
I have Create a Flat tab control Lets say CFTabCtrl , Basically a Class derived from CWnd. I have also implemented Drag drop of these tabs now here is the problem,
When My MFC app has got the complete source of this CFTabCtrl, that is this class is compiled with the project, it works fine.( i m refering to COleDataSource::DoDragDrop())
On the second hand I have created another project And Created a Lib file for this CFTabCtrl, and now in my MFC app I am using this CFTabCtrl by including the lib file and ofcourse the header file of the class. Now the whole code is working fine except for that this COleDataSource::DoDragDrop() returns DROPEFFECT_NONE immdiately ..
does any one have any clue what must have went wrong ?
Abhishek Narula
"Learn to appreciate others ... World would appreciate you"
|
|
|
|
|
Hey everyone,
I am working on an application that I would like to show up on the Windows Explorer context menu. I would like it to be like WinZip, where I add a menu item, then when you click on it, it sends the files to my application file list. I assume that I have to use the Shell API, but I didn't see any articles about this. I did see some on how to add Explorer's context menu to your own file list, but nothing to go the other way. Has anyone done this before and, if so, can you point me in the right direction?
Thanks...
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
check this:
http://www.codeproject.com/shell/shellextguide1.asp
Best Regards
Sonu
|
|
|
|