|
You can enumerate the contents of the Recycle Bin and look at the original location of the files. The only other alternative would be to parse the file system structures (similar to what ScanDisk and NDD do) and look for directory entries marked as deleted. (But even then, the file's data may have been overwritten.)
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
See Here[^]maybe it is some helpful to you
whitesky
|
|
|
|
|
Hi All.
I need to know how can i write some function that getting Folder path and return me list of all file in this folder.
The function will be something like this
void func(CString sFolderPath , CString sFileList)
{
...
...
...
While(bFileExist){
sFileList += File.Name;
sFileList += '\n';
bFileExist = FindNextFile(....);
}
}
Thanks for any help.
|
|
|
|
|
use the shell api SHBrowseForFolder once you select a folder use FindFirstFile and then FindNextFile to retrieve all the files under that folder.
hope this helps
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
See
<br />
(1)<br />
TCHAR lpt[260];<br />
lpt[0]='\0';<br />
strcat(lpt,"c:\\");<br />
GetCurrentDirectory(sizeof(lpt),lpt);<br />
DlgDirList(lpt,IDC_LIST2,NULL,DDL_DIRECTORY|DDL_ARCHIVE);
-----------------------------<br />
(2)<br />
WIN32_FIND_DATA find;<br />
HANDLE handle=FindFirstFile("*.*",&find);<br />
while(FindNextFile(handle,&find)!=0)<br />
m_List2.AddString(find.cFileName);
FindClose(handle);
whitesky
|
|
|
|
|
Hey folks!
I'm installing an Internet application which requires a cookie to authenticate. Because it's a low-risk application, I'm using persistent sesssions.
I'd like users to have to enter a login/password to access the service.
There are a bunch of issues with this (checking for valid input, not letting users advance in the installation if they can't enter their login/pass correctly, grabbing the cookie back from the response) and I'd like to know if there are any *free* (not GPL or LPGL) classes or projects, which would allow me to plugin this feature into my application. i.e. i'm looking for login functionality like you might see such as with MSN Messenger.
C++ / MFC is available, but no .NET.
waiting hopefully :P,
chasetoys
-- modified at 2:29 Sunday 11th June, 2006
|
|
|
|
|
I've seen controls that look like Oscopes, Histograms and Volt Meters.... but I am looking for one that looks like a thermometer to report back temperarture... for use in C++/MFC application
Does anyone have any like that or can point me to something.
Regards and thanks in advance
Pierre
|
|
|
|
|
|
Those are slider controls... not thermometers
but thanks for trying
Regards
Pierre
|
|
|
|
|
pblais wrote: I've seen controls that look like Oscopes, Histograms and Volt Meters.... but I am looking for one that looks like a thermometer to report back temperarture...
That is something that looks like a thermometer.
If you couldn't find what you want, it shouldn't be too hard to modify it so that it reports temperature.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Those are sliders.... They give input to the application... they don't report anything... And, to be honest, they don't look like thermometers at all
Regards
Pierre
|
|
|
|
|
hi all,
i'm working on my project for exams and i have made a chat application
i have problem in making the client talk or send the other client but i make the client send to the server and the server send the same message to me again,
can any one help me in that please
|
|
|
|
|
Me doing your homework? No.
Helping you with specific problems and unexpected behaviour of your code? Yes.
Post what you have, tell us what doesn't work and you will get tons of replies. To THIS question, this probably will be the only reply.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Hallo
I'd like to add a menu to a propertysheet. The menu has the same look for all bags (only different Functions)
THX
Timen
|
|
|
|
|
I'm getting errors about something called RTC. What does it do, and what library can I find the functions for it in?
__________________________________________
Let's push Satan
|
|
|
|
|
search MSDN for : The Microsoft Real-Time Communications (RTC)
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
I used GetPrivateProfileSectionNames to retrieve a list of the section names. The only problem is that I now have all the names stored into one char array seperated by \0s. What would be the best/easiest way to split the string up into individual char arrays. Also note that there won't be a set number of section names. Thanks for any help.
|
|
|
|
|
The easiest way is to use one of the container classes and one of the string classes, I recommend std::vector and std::string. Then simply copy the strings from the input buffer.
std::vector<std::string> names
char * ptr = buffer;
while (*ptr)
{
names.push_back(ptr);
ptr += strlen(ptr) + 1;
}
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Here is a way to parse the buffer and load each string into a CStringArray. If you need to.
<code> LPTSTR lpszBuffer = new TCHAR[512+1];
DWORD dwRet = GetPrivateProfileSectionNames( lpszBuffer, 512, lpszFile );
if( dwRet == 0 )
return;
CStringArray secnames;
secnames.RemoveAll();
LPCTSTR p = lpszBuffer;
DWORD dwLen = _tcslen(p);
while( dwLen > 0 )
{
p = &p[dwLen + 1];
secnames.Add(p);
dwLen = _tcslen(p);
}
delete [] lpszBuffer;
for(int i = 0; i < secnames.GetSize(); i++)
{
if( !secnames.GetAt(i).IsEmpty() )
m_cIniEdit.ReplaceSel("["+secnames.GetAt(i)+"]"+"\r\n");
}
</code>
-- modified at 16:31 Saturday 10th June, 2006
|
|
|
|
|
Thanks for all the help so far, but i still can't get it to work. I'm trying to display the section names in a combobox using
SendMessage(hCombo, CB_ADDSTRING, 0, reinterpret_cast<lparam>((LPCTSTR)sectionnames))
I've tinkered with it in the code you guys gave me but I can only get the combobox to display the first section. Also, I'm using win32. Anyone know what I'm doing wrong?
|
|
|
|
|
TCHAR *ptr = sectionnames;
while (*ptr)
{
SendMessage(hCombo, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(ptr));
ptr += _tcslen(ptr) + 1;
}
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hi,
I have an array which consist redundant data in it.I want to remove the redundant data and place unqiue data in another array, is there any logic for it.
Thanks in before
James
|
|
|
|
|
|
|
Hi guys!
I have picked up c++ again after a period of rest and I have written a program that is based around random numbers.
Here is what it does: it "calculates" two random numbers (both with a maximum, as you will see in the code. The maximum corresponds with the two arrays of strings stated in the beginning of the main integer) and will output the strings corresponding to those two numbers.
It will, in short, pick a person and pick an activity they can do and put these together to form something like "Mike is eating a sandwich".
In the beginning of the program, the user is asked to input an integer defining the amount of combinations he would like to receive. He might, for instance, type "4" and receive this as output:
Mike is eating a sandwich.
Jack is playing the guitar.
Bella is watching a video.
Dave is playing tennis.
But, and here comes the problem, the program will, in that case, not output those four combinations, but something like this:
Mike is eating a sandwich.
Mike is eating a sandwich.
Mike is eating a sandwich.
Mike is eating a sandwich.
In other words, the program will always use the same random number as it "calculated" for the first combination, thus coming up with the same result for every combination the user wanted.
How can I fix this?
Here's the program, written in c++ and compiled using Borland 5.5:
<br />
WhoDoesWhat.cpp<br />
#include < cstdlib ><br />
#include < ctime ><br />
#include < iostream ><br />
#include < string ><br />
using namespace std;<br />
<br />
int main()<br />
{<br />
<br />
string person[9] = {<br />
"Jason",<br />
"My best friend",<br />
"Uncle Ben",<br />
"Mark",<br />
"Eva",<br />
"Dad",<br />
"My daughter",<br />
"Deborah",<br />
"That kid over there"};<br />
<br />
string activity[9] = {<br />
" is preparing a diner for two.",<br />
" is playing a game of tennis with mum.",<br />
" is making out with his/her girl/boyfriend.",<br />
" is studying his geography exam.",<br />
" is still sleeping.",<br />
" is cruising on his motorcycle.",<br />
" is shooting baskets in the garden.",<br />
" is relaxing by the pool.",<br />
" is coding a simple program in C++"};<br />
<br />
int a = 0;<br />
int b;<br />
int i;<br />
int j;<br />
const int N = 9;<br />
<br />
cout << "Who is doing what? Find out with this program!\n";<br />
<br />
cout << "Of how many persons would you like to know what they are doing?\nThey might be busy doing more things at a time, though!\n"; <br />
<br />
cin >> b;<br />
<br />
cout << endl;<br />
<br />
while (a < b){<br />
srand( (unsigned)time( NULL ) );<br />
<br />
for (i = 0; i < 25; i++) { <br />
rand();}<br />
for (j = 0; j < 25; j++) {<br />
rand();}<br />
<br />
i = (int) N * rand() / (RAND_MAX + a + 3.0);<br />
j = (int) N * rand() / (RAND_MAX + a + 3.0);<br />
<br />
cout << person[i] << activity[j] << endl;<br />
<br />
a++;<br />
}<br />
<br />
cout << "\n\nNow you know a bit more about the people around you!\nCome back later, you hear!";<br />
<br />
getchar();<br />
<br />
return 0;<br />
<br />
}<br />
I hope anyone can help.
Thanks in advance!
Regards,
Peter
-- modified at 12:08 Saturday 10th June, 2006
|
|
|
|