|
|
|
You can use getline()
#include <fstream.h>
void main()
{
char buffer[256];
ifstream file;
file.open("c:\\autoexec.bat", ios::in | ios::nocreate);
if (file.good())
{
while(file.peek() != EOF)
{
file.getline(buffer,255);
cout << buffer << endl;
}
file.close();
}
else
cout << "error opening autoexec.bat" << endl;
} the default delimiter for getline is \n, see msdn for more details.
Hope this helps
sledge
|
|
|
|
|
One solution is std::getline().
string sInput;
std::getline(file, sInput);
Kuphryn
|
|
|
|
|
pFile = pHttpConnection->OpenRequest(CHttpConnection::HTTP_VERB_GET,sObject, NULL, 1, NULL, NULL,INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT);
How to change param number 5 to get all kinds of requests not only text?
I need to fetch a picture in jpeg-format
Thx
|
|
|
|
|
i've to submit a project in my final sem. on building a mail application in VC++ having features of sending,recieving , replying , setting priority ,setting account (POP3 , SMTP ) etc. like Outlook Express . please suggest me good books on this which can provide me all this in single book.
Also suggest me any book on making own POP3 & SMTP server in VC++ .
Also suggest Websites on both
> please mail me at :in_sukhdeepsingh@yahoo.com as soon as possible
deep
|
|
|
|
|
i've to submit a project in my final sem. on building a mail application in VC++ having features of sending,recieving , replying , setting priority ,setting account (POP3 , SMTP ) etc. like Outlook Express . please suggest me good books on this which can provide me all this in single book.
Also suggest me any book on making own POP3 & SMTP server in VC++ .
Also suggest Websites on both
mail me at <in_sukhdeepsingh@yahoo.com>
deep
|
|
|
|
|
I recommend Network Programming for Microsoft Windows, Second Edition
by Anthony Jones and Jim Ohmund for winsock programming.
As for SMTP protocal, search FAQs and Google.
http://www.faqs.org/faqs/
Kuphryn
|
|
|
|
|
Is there any way (In code)from my MFC application to Copy,Paste and rename a file...such as an .exe file?
For example,lets say i have an imaginary .exe file in a folder called "Test".
I want to make a copy of test.exe,rename the copy(not the original)to test1.exe,and place it(or
copy it)to a folder named "Test1".
Is this at all possible?
Appreciate your answers.
Thanks.
|
|
|
|
|
|
|
Take a look at SHFileOperation , MoveFile(Ex) and similar API calls
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hi
How can I open PS/2 port??
thanks
|
|
|
|
|
Why do you want to, do you have something other than a mouse or keyboard attached to it?
--
-Blake (com/bcdev/blake)
|
|
|
|
|
I want to spy Mouse data from PS/2 port . if anyone know , please help me.
|
|
|
|
|
You still skipped the 'why' part of the question. Is this mouse still supposed to work in Windows while you are spying on it? If so you can't just 'open the port' anyways, as if you are reading from it the operating system can't be reading from it at the same time.
If you really need the low level bits coming from the mouse you would have to write a filter driver. To do this, install the DDK and have a look at the sample in src\input\moufiltr. I doubt however that you really need this, and writing drivers is not for the faint of heart.
If you are running on XP or later, you should use the Raw Input model. Have a look on MSDN for RegisterRawInputDevice.
If you have to support older versions of Windows, you should probably stick with hooks. In that case, have a look on MSDN for SetWindowsHookEx.
-Blake
|
|
|
|
|
Hi Blake Coverett
thanks for your reply .
My english writing is very bad sorry.
i want unplug a mouse from computer and turn on it , then after loading the windowsxp , plug in the PS/2 mouse and open it's port and read its data bits .
please more help me .
I guess that RegisterRawInputDevices can help me , but I can't findout it . If possible for you help me more.
|
|
|
|
|
I need this in c++ (console) Anything would be fine. Websites would be 'finer' :P.
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
|
Hello everybody, I got a project when i execute the project an error occurs so i want to convert the project to non UNICOE project can you help me thanx .
Getin, getout and get the job done
|
|
|
|
|
Try changing the configuration of your project to win32debug or win32release.
sledge
|
|
|
|
|
Dude, you need to post exactly what the error is. Otherwise you're very unlikely to get a response, Converting the app to ANSI may well be (and probably is) the wrong thing to do.
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.3 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Hello ,and thanx for responding no errors on compilation but in execution i got this :
Linking...
LINK : fatal error LNK1104: cannot open file "mfc42ud.lib"
Error executing link.exe.
CmeUD.exe - 1 error(s), 0 warning(s)
I talked to some one and he said convert it to non UNICODE project is that right and how thank you very much bye.
|
|
|
|
|
Good grief. Whoever you spoke to doesn't really know what he's talking about!
MFC42UD.LIB is the Unicode debug version of the MFC runtime library (the ANSI version is MFC42D.LIB). If you run the VS installer again, there will be an option to install the Unicode libraries. Make sure it's in your link path as well.
This will take you 5 minutes to do. Depending on how big your app is, converting it to ANSI could take days or weeks! Your friend might be thinking that you can just undefine UNICODE and _UNICODE but things are never this simple! :roll:
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.3 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
i want to add some icones to the items of a tree control but i can't .
please tell me how can i do this . what's the problem of this code?
CImageList m_imgList;
CWinApp* papp=AfxGetApp();
if(papp!=0){ {
HICON hicon1,hicon2;
hicon1=papp->LoadIcon(IDI_ICON1);
hicon2=papp->LoadIcon(IDI_ICON2);
m_imgList.Add(hicon1);
m_imgList.Add(hicon2);
m_tree.SetImageList(&m_imgList,TVSIL_NORMAL);
HTREEITEM chapter;
chapter=m_tree.InsertItem("country",0,0);
m_tree.InsertItem("canada",1,1,chapter);
chapter=m_tree.InsertItem("person",0,0);
m_tree.InsertItem("sonya",1,1,chapter);}
|
|
|
|