|
FindNextFile() finds the next file that matches the pattern given in the call to FindFile() . Since you've only given one file name to FindFile() , FindNextFile() will always return false. To get all the text files, specify "C:\\Files\\*.txt" in the call to FindFile()
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
In the 2nd iteration of upper loop , will not it again retuen the first file with *.text that will again be FileA, I want to get the 2nd file in 2nd iteration that is FileB , and 3rd file in 3rd iteration.
In the inner loop its iterating to all file once then again come to outer loop
Regards.
|
|
|
|
|
No, if you call CFileFind::FindFile ("*.txt"), then it will give you the next file at each itteration of CFileFind::FindNextFile ().
There are two remarks to be made:
1. You MUST call FindNextFile at least once before you can use the outcome of CFileFind. You cannot use the filename immediately after the call to FindFile. So what you do is:
bLoop = Finder.FindFile ("*.txt", 0)
while (bLoop)
{
bLoop = Finder.FindNextFile ();
now you can use Finder.GetPath () or whatever
}
2. There is no telling on the order in which you will receive the filenames. They will come in the order in which they happen to have been registered in the directory. If you need to handle the files in any particular order (e.g. alphabetically or based on age or whatever), you will need to first get all the filenames in a linked list or something like that, then sort them to the desired order and then use the files
Regards
|
|
|
|
|
hi everybody,
i have to understand about bayesian algorith and also implement this .i am beginer about this so please guied me where i have to start reading about bayesian algorith.reply me ASAP.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
I very need source code Lines game That it was Written visual c++(win32 application)
Who know please send for me to luanspkt2001@yahoo.com
|
|
|
|
|
|
toxcct wrote:
Its Usual Buddy.. I prefer not repond to this type of post
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
My problem is that I want to capture all packets which are sent to or received by my computer. However, I don't know how to do that if I don't use WinPcap or Ethereal...I just use the API functions of windows. Would you tell me some instructions about how to do that or point me to some specific websites that show me clearly about the technique. thanks
|
|
|
|
|
vtalau wrote: if I don't use WinPcap or Ethereal...I just use the API functions of windows. Would you tell me some instructions about how to do that or point me to some specific websites that show me clearly about the technique. thanks
look for IPHelper Api! or you can hook WinSock dll.. to see what going out or what coming in , try this link for more HOOK winsock[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
The demo attached to the article you sent me doesn't operate. I can't hook a api function of a dll successfully. By any way, thank you so much for widening my knownledge.
|
|
|
|
|
Hi, I'm now trying to simulating keyboard stroke that affect all application that running but i experiment that keybd_event(...) and SendInput(...) doesn't effect to the application that using DirectInput. Hook is useless too! May you help me solve this problem! Thank very much.
Note: I read the DirectX documentation and I known that DirectInput connect directly with hardware's driver;may it is helpful.
|
|
|
|
|
The problem is, what key stroke are you trying to send, and what result do you expect ? Sending an event to an app will not send it to a text box on the visible window. DX won't help, it's just another layer you need to get through. Most apps are not using DX.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i know there is few app using DirectInput, but i want simulate keystroke perfectly; i want a DirectInput app receive the keystroke. As i said: when i using SendInput(...) the DirectInput app can not receive the key(any key) but another app can receive it normal. i think hook is useless because DirectInput app doesn't receive keyboard frome system message queue and i think SendInput(...) only place keyboard message to system message queue so that the DirectInput app can't receive this keystroke.
From model of keyboard of MSDN library: i think i need a function that can send keystroke to the keyboard's device driver. Please help me!
|
|
|
|
|
i have been trying to learn how to do directx programming in c++ but have not found any source code from tutorials that will compile. i am using visual studio express edition. when i try to compile the code that came with the directx 9 sdk it gives me errors for the include file 'winnt.h' such as:
winnt.h(222) : error C2146: syntax error : missing ';' before identifier 'PVOID64'
winnt.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
winnt.h(5940) : error C2146: syntax error : missing ';' before identifier 'Buffer'
winnt.h(5940) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
winnt.h(5940) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
what is causing this and how can i fix it? the only include file that i have is d3d9.h.
also if anyone can point me towards a good direct3d beginners tutorial it would be very helpful.
thank you in advance for any help you can offer
- Kyle
|
|
|
|
|
try to change the compiling version from the current into another ,
let see if it will work
|
|
|
|
|
suchuhui wrote: try to change the compiling version from the current into another ,
let see if it will work
how do i do this?
- Kyle
|
|
|
|
|
I fixed the errors using the steps on this[^] page. i skipped the 4th step.
thank you for the ideas and input
- Kyle
|
|
|
|
|
Hi All,
I am a noob with VC++ coding so spare with me. I am trying to create an GUI application that will allow the user to create email accounts in Outlook Express. Something like a simple version of the Wizard itself.
The form has 3 fields, where the first field will Propagate the "Display Name", 2nd field will be there "User ID = email address" and 3rd field is their "password".
I am using the following code:
<br />
<br />
void CEmailDlg::OnBnClickedButton1()<br />
{<br />
<br />
<br />
UpdateData( TRUE );<br />
CString custaddy;<br />
CString custpass;<br />
custaddy = custuser;<br />
DWORD dwVal = 0;<br />
DWORD dwDial = 3;<br />
CString URL = "someURL";<br />
CString POP3 = "somePOP3";<br />
CString SMTP = "someSMTP";<br />
CString connectoid = "Dial-up";<br />
int userlength = custuser.GetLength();<br />
if (!custuser.Right(12).CompareNoCase("@realm"))<br />
<br />
{<br />
userlength = userlength - 12;<br />
custaddy = custuser.Left(userlength);<br />
custaddy += (_T("@realm"));<br />
<br />
}<br />
<br />
else if (!custuser.Right(17).CompareNoCase("@anotherrealm"))<br />
<br />
{<br />
userlength = userlength - 17;<br />
custaddy = custuser.Left(userlength);<br />
custaddy += (_T("@anotherrealm"));<br />
}<br />
<br />
else<br />
<br />
{<br />
CString msgString = "Please make sure you enter you full Dial-up email address. This will be in the format of 'username@realm'.";<br />
AfxMessageBox( msgString, MB_OK | MB_ICONEXCLAMATION );<br />
return;<br />
}<br />
<br />
AfxMessageBox("Your email address will now be configured. Click the OK button to proceed.");<br />
HKEY hKey;<br />
unsigned long dwDisp;<br />
<br />
<br />
if(RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Internet Account Manager"), 0,<br />
NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisp) == ERROR_SUCCESS)<br />
<br />
{<br />
RegSetValueEx(hKey, "Default Mail Account", 0, REG_SZ,(BYTE *)(LPCTSTR)custaddy,lstrlen(custaddy));<br />
<br />
RegCloseKey(hKey);<br />
}<br />
<br />
<br />
<br />
if (RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Internet Account Manager\\Accounts\\"+custaddy+""), 0,<br />
NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisp) == ERROR_SUCCESS)<br />
<br />
{<br />
<br />
RegSetValueEx(hKey, "POP3 Server", 0, REG_SZ,(BYTE *)(LPCTSTR)POP3,lstrlen(POP3));<br />
RegSetValueEx(hKey, "SMTP Server", 0, REG_SZ,(BYTE *)(LPCTSTR)SMTP,lstrlen(SMTP));<br />
RegSetValueEx(hKey, "POP3 User Name", 0, REG_SZ,(BYTE *)(LPCTSTR)custuser,lstrlen(custuser));<br />
RegSetValueEx(hKey, "SMTP Display Name", 0, REG_SZ,(BYTE *)(LPCTSTR)custname,lstrlen(custname));<br />
RegSetValueEx(hKey, "SMTP Email Address", 0, REG_SZ,(BYTE *)(LPCTSTR)custaddy,lstrlen(custaddy));<br />
RegSetValueEx(hKey, "Account Name", 0, REG_SZ,(BYTE *)(LPCTSTR)custaddy,lstrlen(custaddy));<br />
RegSetValueEx(hKey, "Connection Type", 0, REG_DWORD,(const BYTE *)&dwDial,sizeof(dwDial));<br />
RegSetValueEx(hKey, "POP3 Password2", 0, REG_BINARY,reinterpret_cast<const BYTE*>(static_cast<LPCTSTR>(custpass)),(custpass.GetLength()+1)*sizeof(TCHAR));<br />
RegSetValueEx(hKey, "SMTP Use Sicily", 0, REG_DWORD,(const BYTE *)&dwVal,sizeof(dwVal));<br />
<br />
RegCloseKey(hKey);<br />
}<br />
<br />
But the problem with this is, i am unable to get the password stored properly as a Binary format.
Can anyone have a look and give a solution for this code?
Thank you in advance.
amano
|
|
|
|
|
The password is encrypted, so unless you know the encryption method used you will not be able to read or save the password using registry functions.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks PJ,
Would anyone happent to know what the encryption would be???
And how could i be encrypting it once i do know what the encryption is?
amano
|
|
|
|
|
Hello everyone!
Alright... It's been over 2 weeks of trying to fix this now...
Here's a file:
|............||......................................................................................................................................................|.............|
I open the file using fopen(), then I read it using this:
<br />
fseek(f[x], i*(WIDTH/32)+j, SEEK_SET);<br />
char v = fgetc(f[x]);<br />
WIDTH/32 is 16, i and j are here:
for (int i = 0; i < HEIGHT/32; i++)<br />
{<br />
for (int j = 0; j < WIDTH/32; j++)<br />
{
I have a temporary file stream to "outputz.txt", and after a byte has been read, it is written to that outputz stream... But, at the end, this is what I get on outputz.txt:
...........................................................................................................................................|............|ÿ
Kinda different from the first file, eh? What could be the problem?
Here's my function:
http://sulfurmidis.com/func.htm[^]
Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
Instead of having a file full of periods, why not run a text file through your function? Using a text file that you can read will give you the ability to quickly see what characters you are missing, or reading double etc. Using just periods makes it really dificult to figure out what is going wrong.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
AHA!! YES I FINALLY GOT THERE!!!
(A while ago, I went to a friend's house with my laptop, and I was making this program, and I had gotten to a point in which I was almost about to fix it! But the battery ran out, and I fell asleep as soon as I got home, and the next day I forgot how to get there again... ) But now I got to that point again!
Look at the file again:
|...........||.......................................................................................................................................................|.............|
outputz.txt outputs exactly like the original (except with 1 extra space at the end), but now it looks like it's a rendering problem... Can you check out my rendering function also?
It has another temp stream, "temp.txt", which outputs this:
|..............................................|.....................|..................................................................|..........|................................
Totally different, as you can see... This function uses the values from this->mapLayers , which I made when in the first function I posted, instead of characters... Here's the new func:
(I was gonna upload it, but my crappy-butt host timed out when accepting my password)
void Mazzee::DrawMap()<br />
{<br />
FILE * temp = fopen("temp.txt", "wb");<br />
<br />
for (int v = 0; v < 1; v++)<br />
{<br />
for (int x = 0; x < WIDTH; x += CHARW)<br />
{<br />
for (int y = 0; y < HEIGHT; y += CHARH)<br />
{<br />
SDL_Rect src, dest;<br />
<br />
if (v == 0)<br />
{<br />
if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == LX_EMPTY) fputs(".", temp);<br />
else if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == L1_GRASS) fputs("|", temp);<br />
<br />
if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == LX_EMPTY) src.x = 0;<br />
else if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == L1_GRASS) src.x = CHARW;<br />
}<br />
else if (v == 1)<br />
{<br />
if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == LX_EMPTY) src.x = 0;<br />
else if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == L2_ROCK) src.x = CHARW;<br />
}<br />
else if (v == 2)<br />
{<br />
if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == LX_EMPTY) src.x = 0;<br />
else if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == L3_TELEPORTER) src.x = CHARW;<br />
}<br />
else<br />
{<br />
MessageBox(NULL, "Hi!", "None was found...", MB_OK);<br />
}<br />
<br />
src.y = 0;<br />
src.h = CHARH;<br />
src.w = CHARW;<br />
<br />
dest.x = x;<br />
dest.y = y;<br />
dest.h = CHARH;<br />
dest.w = CHARW;<br />
<br />
SDL_BlitSurface(this->mapLayerTiles[v], &src, this->screen, &dest);<br />
}<br />
}<br />
}<br />
<br />
fclose(temp);<br />
}<br />
Any ideas? Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
I would recommend using C++ for file handling.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: I would recommend using C++ for file handling.
Why? I'm earnestly interested in your reasons. I'm used to the c-style versions and would like to know if I'm missing out on something I'm not aware of.
Jeremy Falcon
|
|
|
|
|