|
Hi,
Hope one of the following article can help you:
Article 1[^]
Article 2[^]
Article 3[^]
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
hi
tnx
But i need to create a new ActiveX with an existing one.
while i am trying to do so, i am not getting the display properly.
while putting it on a web page there was no display.
when i removed the activex from my new activex it worked.
why it happens so?
|
|
|
|
|
I want to open a excel from vc++.
I used automation..
I am able to open the xls file without any problem..but i am not able to open the text file..
the only problem is Its not delimiting properly...
can anyone help me how to delimit(SPACE)..
This is the code i have used...
---------------------------------------------------
_Application app; // app is the Excel _Application object
COleVariant VOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
_Workbook objBook;
Workbooks objBooks;
Worksheets objSheets;
_Worksheet objSheet;
// app is the Excel _Application object
// Start Excel and get Application object...
if(!app.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Couldn't start Excel.");
}
else
{
//Make Excel Visible and display a message
app.SetVisible(TRUE);
objBooks = app.GetWorkbooks();
long xyz=1;
COleVariant bNo;
bNo.boolVal=FALSE;
COleVariant bYes;
bYes.boolVal=TRUE;
//It is working fine.. only problem is i am not able to specify the delimiters...
// If i open an excel file its working fine... but if i open a text file... its giving error...
//how to separate with delimiter.
//objBooks.OpenText(((
objBooks.OpenText("F:\\test.txt",VOptional,VOptional,VOptional,xyz,bNo,bNo,
bNo,bNo,bYes,bNo,bNo,VOptional,VOptional,VOptional,
VOptional,VOptional,VOptional);
Chitra Sankaran
|
|
|
|
|
Hi,
Read through this thread[^] maybe it can help you.
or
Automate Excel[^]
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
I read already those threads...
The problem is i am not able to read a text file...
how to delimit the text file..
|
|
|
|
|
Why are you using OpenText() instead of Open() ? I use the latter with text files, but OpenText() will work also.
In any case, what error are you receiving?
"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
|
|
|
|
|
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
|
|
|
|