|
why it's necessary to create iterator for a file buffer? you don't need to deal with internal buffer of a file. You can simply use other stream, string classes to get your task done. Just see a sample code below. it's plain and clear no? (Sorry it's not written myself. taken from some forums)
#include <iostream>
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
int main ()
{
ifstream inFile ("csv.dat");
string line;
int linenum = 0;
while (getline (inFile, line))
{
linenum++;
cout << "\nLine #" << linenum << ":" << endl;
istringstream linestream(line);
string item;
int itemnum = 0;
while (getline (linestream, item, ','))
{
itemnum++;
cout << "Item #" << itemnum << ": " << item << endl;
}
}
return 0;
}
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
thank you
for your replies
|
|
|
|
|
Hi All,
I have a com dll which i want to use without registering it so is it possible? i tried it this way but while trying to call its functions i am not getting its reference....
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Check this![^]
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
hi,
i read all the menifest stuff required...so there is no other way accept suggested one to do the thing...
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Hai All,
I have a shared folder in WAN(windows server 2003) and I have to access that folder through programming by hard coding the credentials(from windowsXP).
Regards
ranjith
|
|
|
|
|
The suspense is killing me. What's the question?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Thanks for response
I have a shared folder in server ,I have to access the files from that folder to client system ,If we open that file directly it's asking username ,password of server .
My requirement is client should not know the server's password,we have to hard code the username and password.
Thanks®ards
Ranjith
|
|
|
|
|
Can you use NetUseAdd() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Look for the ::WNetUseConnection()-API. The similar use is deomstrated here:
http://www.codeproject.com/KB/cpp/DrivesManager.aspx
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
sir
please send me coding in C for K-Nearest Neighbour algorithm for calculating
the distance between the training data(in binary or run-length encoded) and
test data ib the same format for hand written pattern recognition.
thank u
|
|
|
|
|
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
I want select a certain area from an image, and I kenw in cximage exits selection layer,I wonder if the pointer "pSelection" is can be used to point to part of the image,not the whole image.
and the function BYTE* selectionGetPointer(x,y)
Suppose I gave the start coordinates x,y of a area,
if the return value can be regared as the pointer which points to the beginning pixels of a selectiron area ??
|
|
|
|
|
I have a service x dependent on a service y.
When I reboot the workstation the service x is started after y is started.
Soon service x dies out. Now I need to restart the service x for it to be up and running.
Any known issues with this type of behaviour please let me know?
|
|
|
|
|
tom groezer wrote: Now I need to restart the service x for it to be up and running.
Any known issues with this type of behaviour please let me know?
Sounds reasonable.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
In normal scenario of what is the expected behavior this dependent service need not to be restarted after it dies out on a reset. This is erroneous behavior. What could be the possible reasons for this?
|
|
|
|
|
Hi,
I have an MFC application.
I run a thread in middle. After completing the thread i have a message box that popsup. But messagebox doesnt have focus.
Can anyone let me know how to get the focus back to message box? Thanks in advance.
Code snippet:
....
RunCmd("test.bat", SW_SHOW);
MessageBox("dfas","fdifd",MB-OK);
.....
Test.bat has come command to format disk etc.
Regards..
|
|
|
|
|
|
Thanks for the reply. But that doesnt have the answer for my problem.
After launching a thread and completing the foucus is not going to main window.
In a dialog based application, I run:
WinExec("test.bat");
Sleep("5000");
MessageBox("sdosn"....);
MessageBox is not having focus. If i remove Thread executions in between (WinExec). Then i get the focus properly.
Any updates on this.
|
|
|
|
|
Member 3834630 wrote: WinExec("test.bat");
Firstly I want to say that WinExec function is Obsolete. you should use, CreateProcess() or ShellExecute() to create new process.
Member 3834630 wrote: MessageBox is not having focus. If i remove Thread executions in between (WinExec). Then i get the focus properly.
Means if you comment out the WinExec() function, your message box is getting the focus and after closing the messagebox, your main dialog is getting the focus?
|
|
|
|
|
Hi,
Sorry, I am actually using CreatProcess() only. To make it simple i put WinExec()
But after calling CreateProcess() which calls a batch file and after completing the process, i display a MessageBox(sdkjfo..), the MessageBox() gets displayed but doesnt have the focus.
Yes, if i comment the CreateProcess() then MessageBox() gets the focus.
Regards.
|
|
|
|
|
Did you try modifying the code as I mentioned yesterday?
WinExec("test.bat");
Sleep("5000");
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
GetCurrentThreadId(),TRUE);
MessageBox("sdosn"....);
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
GetCurrentThreadId(),FALSE);
|
|
|
|
|
Yes, this worked.. Thank you.
If you dont mind, Can you explain why it was earlier failing with out the code and what this code does.
|
|
|
|