|
That is what it is!
Owner drawn
Jesus Loves
|
|
|
|
|
Just assign it:
char *data = "This is some data";
CString str = data; If you're compiling for unicode, use the ATL A2T() macro.
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"
|
|
|
|
|
Ryan Binns wrote: If you're compiling for unicode, use the ATL A2T() macro.
Little correction Sir, we can use TCHAR instead of char to avoid use of macro like A2T
"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
|
|
|
|
|
ThatsAlok wrote: Little correction Sir, we can use TCHAR instead of char to avoid use of macro like A2T
I'm well aware of that, but his question specifically stated that he had a signed char , not a TCHAR .
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"
|
|
|
|
|
HI,
Suppose I have following files
FileA.txt, FileB.txt, FileC.txt, FileD.txt, FileE.txt in the Directory C:\\Files\\
I want to create new files like FileA-FileB.txt merging the text of both files.
Then FileA-FileC.txt then another FileA-FileD.txt, then FileA-FileE.txt
I have created the above all the first file and its combination with other files
but the problem is in remaing
Means create the combinations of one file with all other.
After first one create FileB-FileC, then FileB-FileD , then FileB-FileE . after that skip second one and create the combination of 3rd and forth file. so on
When I ends up with first file combiantoin with other then I do
BOOL find = finder.FindFile("C:\\Files\\FileA.txt");
BOOL get = finder.FindNextFile(); // to get the second file again , to make its combinations
but here get give false;
Why not it finds again the next file to the fileA. and return true.
Thanks
Regards.
|
|
|
|
|
Hello!
Ur question is not very clear.
"If you change then change for the good."
|
|
|
|
|
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!
|
|
|
|
|