|
HANDLE find;
WIN32_FIND_DATA wfd;
find = FindFirstFile( "path/to/your/folder/*.*", &wfd );
if( INVALID_HANDLE_VALUE != find )
{
do
{
// wfd will contain the data of the current file
}
while( FindNextFile( find, &wfd ) );
FindClose( find );
}
|
|
|
|
|
|
You must call FindNextFile() before you use the values in the WIN32_FIND_DATA structure:
HANDLE find;
WIN32_FIND_DATA wfd;
find = FindFirstFile( "path\\to\\your\\folder\\*.*", &wfd );
if( INVALID_HANDLE_VALUE != find )
{
while( FindNextFile( find, &wfd ) )
{
}
FindClose( find );
} P.S. The convention on Code Project is to enclose blocks of code in <pre>...</pre> tags.
Software Zen: delete this;
|
|
|
|
|
Gary R. Wheeler wrote:
You must call FindNextFile() before you use the values in the WIN32_FIND_DATA structure:
are you sure?
|
|
|
|
|
This is all i have to say.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/findfirstfile.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/findnextfile.asp
make sure you read the description of the second paramter on FindFirstFile and the remarks
P.S. I don't give a rats ***
Hey! Look at this nice litte example which happens to use the data in the WIN32_FIND_DATA structure before FindNextFile is called
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/listing_the_files_in_a_directory.asp
|
|
|
|
|
Oops. It looks like you're right .
Although, it doesn't really make a difference, in this specific case, since FindFirstFile() for *.* will return the current directory (named ". ").
Software Zen: delete this;
|
|
|
|
|
Hi all:
I have a titleless dialog(for some reason), which has a constructor like
MyDlg(CWnd* pParent = NULL);
But somehow I want to add a button to this dialog which have the standardize minimize funtion.
here is the customized minimize funtion's implementation
<br />
void MyDlg::OnBtnMinimize()<br />
{<br />
ShowWindow(SW_MINIMIZE);<br />
}<br />
But after I clicked the minimized button it just disappears. Later I found it(just part of this dialog) positioned at somewhere in the lower left corner of the desktop and just above the system taskbar. It obviously not positioned at the system taskbar.
How can I get the standard minimize function without the title bar? Do I have to pass the return value from GetDesktopWindow to Mydialog dialog, I tried It didn't work!
|
|
|
|
|
|
Thanks for your WS_EX_APPWINDOW answer, it works.But if you don't mind I wanna ask you few more questions which related to this one.
When I clicked the minimize button, this dialog does positioned at the sys taskbar. But what makes it not so good is it doesn't have caption when It appears in the sys taskbar. I've tried to add CAPTION "" to the script and it worked but it at the expense of just the part of dialog appears not as whole.How can I get a caption at the taskbar(still does't have caption bar) when It minimized or maximized?
Furthermore, When I click the dialog at the sys taskbar consecutively, It seems not responding well, it only get minimized. Which should be get maximized and minimized correspondingly.
Thanks fot your time and patience!
|
|
|
|
|
I have been trying to debug my Add-In for Visual Studio .NET 2003 on Windows XP SP2. I seem to be always getting an error message with the error code 800a0030. I have tried using Error Lookup but even that can't tell me what the code means, it just says error message not found. I have also looked through all the files that come with VS .NET 2003 to see if I can find it there but no luck.
Does anybody know?
I am the handsome one in the crowd.
|
|
|
|
|
The file WinError.h has a table at the beginning that explains the what the bits in the error code are used for. The copy I have here (VS 2002) does not have a definition for error 48 (0x0030) but maybe yours does. Also, depending on what technology you are using, error code 48 could be defined in some other file. But then again, it could just be a custom error that is not defined anywhere
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Well according to google[^], the error seems to be 'Error loading DLL'
Does your error message give any more information, like the name of the DLL. At a guess, Visual Studio doesn't like something in your add-in; maybe a missing interface or a problem in the DLL initialization code.
Michael
CP Blog [^]
|
|
|
|
|
No I just get the error code. It seems like the error occurs when I make use of the VCCodeModel functions. . I can't even step into the function (the exact name I can't remember at the moment, I think it has to do with getting a project from a collection of projects)
I am the handsome one in the crowd.
|
|
|
|
|
I want to set color and a font different with my dialog font for a text on dialog. Please help me, thank you very much
|
|
|
|
|
Handle the ON_WM_CTLCOLOR() message
like this
HBRUSH CWFSEC2MailerTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor){<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
CBrush *brush;<br />
brush = NULL;<br />
CWnd* pStaticWnd = (CWnd*)GetDlgItem(IDC_STATIC_STATUS);<br />
if(pWnd == pStaticWnd){<br />
pDC->SetTextColor(RGB(0, 0, 255));<br />
}
pStaticWnd = (CWnd*)GetDlgItem(IDC_STATIC_INFO_DOC);<br />
if(pWnd == pStaticWnd){<br />
if(lock_docstatus_text){<br />
pDC->SetTextColor(RGB(0, 100, 200));<br />
}
else{<br />
pDC->SetTextColor(RGB(0, 0, 255));<br />
}
}
pStaticWnd = (CWnd*)GetDlgItem(IDC_STATIC_INFO_SEND);<br />
if(pWnd == pStaticWnd){<br />
if(lock_sendstatus_text){<br />
pDC->SetTextColor(RGB(0, 100, 200));<br />
}
else{<br />
pDC->SetTextColor(RGB(0, 0, 255));<br />
}
}
return hbr;<br />
}
more info you can find on msdn I think.
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Thank you very much, I will try
|
|
|
|
|
Ok, i have a dialog which i made with the resource editor. all the code is done with pure win32, no MFC.
Now when i have list control on the dialog, the CreateDialog function fails and the dialog is not created. When i set the "No Fail Create" (or something like that) prop on the dialog, the function succeeds the window is made but the list control doesnt show up.
when i take the list control off, it doesnt matter whether the "no fail create" prop is set or not, the function succeeds and everything works fine.
i also have the same problem when i add a progress bar.
extra info:
a while back, i made a MFC project that used a list control and a progress bar, the list control caused no problem, but when the progress bar was put on the dialog, the program crashed.
|
|
|
|
|
|
that didnt seem to make a difference
keep in mind im not using MFC, and i dont plan on it.
i suspect that function is for MFC?
seems to be alot of trouble to get access to it.
|
|
|
|
|
|
some people are just better at finding things on msdn than others, guess you are one of them.
thanx to both of you
|
|
|
|
|
I want to connect Oracle database through VC++ without using ODBC connection.
I got OCL library from http://crlab.com/ocl but its not working properly.
Can anybody provide me a sample code for this problem(Connection wiht Oracle 9i database through VC++ without ODBC connection).
|
|
|
|
|
Hello all,
I would like to get a small help from you all. My company is planning to develop a software which writes a CD/DVD on the fly. The input of the writer will come directly from a webcamera through any encoder software. The important thing is the data is not keeping as a temporary backup in hard disc but it is writing directly. As soon as the camera stops(Or before 30 sec.) I would like to get the CD in return with all of the captured images like a video CD.
Anybody have similar products? Please give me some idea.
It would be a great help for me if you have any idea about the usage any API in the writing section.
Thanking you in advance. Please help me at your maximum.
Manu Philip
|
|
|
|
|
I did something like this for backup software.
First, if you have a choice use DVD+R or DVD+RW for this, because they have the best support for preventing "underrun". In fact if you are using CDs, to be legal you must be sure that your datastream is always big enough to write data when the drive is ready! (even if you are not!) I break this rule all the time on a modern drive, without too many problems, but if you sell this you need to require that your customers have a drive with good underun protection.
Next, go to www.t10.org and buy the MMC standards. (you can download them too, but not the latest versions...) You might want to consider joining, depending on how technical your people are. t10 is the scsi standards orginization. Every CD writer that is faster than 4x is scsi! (it may be electrically IDE or USB, but it speaks the scsi standard, so that is what you care about). Read the standard several times until you think you understand it.
Now, figure out how to send SCSI commands on your os. On Windows NT/2000/XP it is a device_ioctl SCSI_PASSTHROUGH_DIRECT (or something like that). Windows 95/98/me uses something else. Unix is something different again, different for each unix.
Next you need to figure out what standard you will write data in. I don't know anything about the video CD standard, so I can't help you there. You can define your own format if you don't care about nothing else being able to read the disk.
If you want to write a file, then you can either figure out UDF (I didn't, but this is perhaps the right way to go), or you can write ISO-9660. ISO-9660 is most easially found under the name ECMA-119. Get the spec, and learn that inside and out. There is just one detail you need to know: reserve a track at the begining of the disk, then write data to the next track, when done you write your directory to the reserved track.
It took me about 4 months to write this myself (design through release). I had the advantage of a SCSI abstraction layer in place so I didn't need to worry about many of the details you will need to learn. Once you understand the standards and have a design the code is only a couple weeks, but it takes a while to figure out how to read all the standards.
Good luck. If you have any more questions let me know, but not until you have studied all the documents I listed above!
|
|
|
|
|
Hi All,
I am creating Print Processor that allows AS400 to send the print job via network. The print processor will then do the conversion from EBCDIC to ASCII. However, if something goes wrong (INI file missing, etc...), I would like the spool file (SPL/SHD) remains in the Print Queue.
I have tried to return FALSE in PrintDocumentOnPrintProcessor(), but still, the spool file gets removed. How can I preserve the spool file (SPL/SHD file)?
Thanks for any help in advance
Cheers...
Samin Thomas
|
|
|
|