|
I am not getting any error...
its opening the text file..
but the problem is...
if my text file contain the data as 27 1 1 0.0 30.0 41.11
it is putting the value as
2 7 1 1 0.0 30.0 41.11
2 in first cell...
7 1 1 in second cell
0.0 30.0 41.11 in third cell...
its not putting 27 in first cell 1 in second cell 1 in third cell and so on...
can u help me...
thanks
|
|
|
|
|
artihcv wrote: can u help me...
I thought I already did. Use:
books.Open("c:\\book1.txt",
COleVariant(0L),
vtFalse,
COleVariant(6L),
vtOptional,
vtOptional,
vtTrue,
vtOptional,
vtDelim,
vtOptional,
vtOptional,
vtOptional,
vtFalse,
vtOptional,
vtOptional); If you still need to use OpenText() , try:
books.OpenText("c:\\book1.txt",
COleVariant(1L),
COleVariant(1L),
COleVariant(1L),
-4142,
vtFalse,
vtFalse,
vtFalse,
vtFalse,
vtTrue,
vtFalse,
vtOptional,
vtOptional,
vtOptional,
vtOptional,
vtOptional,
vtOptional,
vtOptional);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks a lot sir..
I tried using OpenText.. its working...
sorry to disturb u...
still i am finding it difficult to pass delim...
My delimiter is space...
how to pass space as parameter...
Thanks..
Chitra
|
|
|
|
|
artihcv wrote: how to pass space as parameter...
That's what the tenth argument to OpenText() is for.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
sir.,
one more doubt..
i am having both tab as well as space delimiter in text file...
if i use the above code its giving boxes...
how to overcome that..
|
|
|
|
|
artihcv wrote: if i use the above code its giving boxes...
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
sir one more doubt...
i am having both space and tab delimiters in my text file..
if i use the above opentext i am gettting boxes only..
how to overcome this..
Thanks in advance
chitra
|
|
|
|
|
You should not open a .txt file like this. Because there is no need for any automation in this.
You use this...
CStdioFile myFile;
CFileException fileException;
myFile.Open( "F:\\test.txt", CFile::modeCreate | CFile::modeReadWrite|CFile::modeNoTruncate, &fileException );
myFile.Write(const void* lpBuf, UINT nCount);
myFile.close();
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Hi, I need to create a Setup.exe of mi app. I have a problem.
What I have done is that:
Build->Configuration->Select Release
Compile, build
There was an error:
fatal error C1083: Cannot open precompiled header file: 'Release/TMB.pch': No such file or directory
I changed the settings and selected
Precompiled Headers->Not using precompiled headers
But now it says:
error LNK2001: unresolved external symbol _dbdead
error LNK2001: unresolved external symbol ...
error LNK2001: unresolved external symbol ...
error LNK2001: unresolved external symbol ...
about 30 times.
What should I do?
Time to come clean...
Vive y deja vivir / Live and let live
Javier
|
|
|
|
|
Hi,
hope this might help
While programming in VC++ using dblibrary for c I too got some Unresolved externals error.
I don't know much about your IDE,but here's what I did in VC++
1. clean your solution: Build > Clean Solution
2. found out the name of the required lib file
3. Project > settings> links tab , added the .lib file name to list of Object/Library modules
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
How to store and retrieve the properties of an object using Serialize?
|
|
|
|
|
Serialization is a topic (i.e. your question is a bit too broad): Google is your best friend.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CObject ... DECLARE_SERIAL .... Serialize ... IsStoring ... are the clues
Regards,
Swathi
"a child will grow up to become an adult, but you can never stop the adult from acting like a child"
|
|
|
|
|
I found this series of articles[^] quite interesting.
|
|
|
|
|
I am looking for a library, using which one can access philips 9400 devices. Library with read/write/download/delete files to/from device compatibility. Please help me. It's very urgent for me.
my email id:
amresh.kumar@photoninfotech.net
|
|
|
|
|
hi can we get the boot priority configuration in windows through mfc code? i am having first bootable as harddisj, second as some external device and third on as usb drive. how to get this through our mfc code?.pls help me
|
|
|
|
|
Hi all:
I am having a problem here:
void WordTable::addWord(string newWord, streampos pos_newWord){}; is the function signature of the function "addWord", which is a member of class "WordTable".
It receives two input arguments, one string "newWord" anther one streampos "pos_newWord".
WordTable has a private variable "table" which is of type "map". It is defined as:
map<string, vector<streampos="">> table;
When "addWord" receive two arguments, I use:
this->table.insert(make_pair(newWord, ((this->table).second).push_back(pos_newWord)));
to store the variables into a table. But I keep getting error messages telling me "second is not a member of map<_Key, _Val."
Can anyone help?
Thank you
|
|
|
|
|
I don't understand what you are trying to do. And your code doesn't display nicely because you didn't select the code tag.
second will only work on iterators, not on the map itself so what are you trying to do there ?
|
|
|
|
|
Hi:
Thank you for your reply.
Basically, what I try to do is to read from a text file and put every word and their associated positions in the file into a container, "table" of map type.
"table" is defined as:
public:<br />
typedef vector<streampos> OccurrenceList;<br />
private:<br />
typedef map<string, OccurrenceList>::iterator WordIterator;<br />
map<string, OccurrenceList> table;<br />
public:<br />
WordTable(void);<br />
void addWord(string word, streampos pos);
"addWord" is defined as:
void WordTable::addWord(string newWord, streampos pos_newWord)<br />
{<br />
if (this->table.empty()) {<br />
this->table.insert(make_pair(newWord, ((this->table).second).push_back(pos_newWord)));<br />
}
What I try to achieve is: when a new word is read from the file, I will store the word itself (as a string) and its position in the file into "table".
Thank you
|
|
|
|
|
What are you trying to do here:
((this->table).second)
A map doesn't have any member called second, only iterators have. So there is something wrong there.
Also, how is your map declared (when using < and >, you need to replace them by the symbols next to the code tag). Can't you simply do something like that:
table[newWord] = pos_newWord;
And what happens if a same word appears several time in the file ?
|
|
|
|
|
Hi,
I think your are trying to add multiple occurrence of the word in a vector list in the corresponding word entry.
you may do like this,
<br />
void WordTable::addWord(string newWord, streampos pos_newWord)<br />
{<br />
map<string, OccurenceList>::iterator Iter;<br />
Iter = table.find(newWord)<br />
if (Iter == table.end())<br />
{ <br />
OccurenceList list;<br />
list.push_back(pos_newWord);<br />
table.insert(make_pair(newWord, list));<br />
}<br />
else<br />
{<br />
Iter.second.push_back(pos_newWord);<br />
}<br />
.<br />
.<br />
.<br />
In your code I think your are also inserting multiple times the same word.
And Also you may make this more simpler if your are using multimap
<br />
<br />
multimap<string, streampos> table;<br />
then you simply needs to do <br />
table.insert(make_pair(newWord, pos_newWord));<br />
Best Regards
-- modified at 0:12 Friday 1st June, 2007
|
|
|
|
|
Hi:
This is exactly what I did, (did not use multimap()) and it worked.
Thank you very much.
|
|
|
|
|
|
Maybe reporting the exception text will help.
BTW, have you a FilterKey field in your table. Do you want to popolate the combo (i.e. add items) or set its text?
BTW2: wrong forum?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
this stinks like managed code on a wrong forum...
as your question on the right board buddy
|
|
|
|