|
|
Hi,
i guess you need to go through automation please see any standard MFC book and you can sail through easily,reading of excelfile is most time consuming if they have large data ,if posible convert them to CSV ( if you can ) and then parse them as you do on a text file . actually you can convert all the above formats to text format and parse ,for that you need to CreateDispatch on the respective application object and ask them to save the coressponding data in text formats .
Regards,
FarPointer
|
|
|
|
|
I don't want to work with any afx_msg, I just want to test if the mouse button is clicked in the moment, something like if(GetKeyState(VK_SHIFT)&0x8000) function, but this is for keyboard using.
How can J do that,
Thank you
|
|
|
|
|
ZaebanB wrote: I just want to test if the mouse button is clicked in the moment...
Have you considered the WM_LBUTTONDOWN message?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
No, J don't want to catch any message.
|
|
|
|
|
Use GetAsyncKeyState .
Steve
|
|
|
|
|
|
I have two large projects, both containing exactly the same code, under Visual Studio 2005. One of the projects is under Source Safe and one is not. In the one that is not under Source Safe, Class View works fine. I can scroll the long list of classes, and when I select one, I can scroll the long list of members of that class. In the identical but Source Safe-controlled project, both the class list and the member list get redrawn about once per second, FOREVER. Literally hours after opening the IDE, they still flash. It is impossible to scroll either list because if you do, on the next redraw (after one second), it will scroll back to the top. The flashing stops if you display a context menu, but resumes when you dismiss it.
This makes class view totally useless. Any clue how I can fix this? I'm not saying that Source Safe is the cause, only that that and the fact that the one under Source Safe was migrated from VS7 and the one not under Source Safe was created with VS8 are the only differences between these two projects.
[Added later]
I see now that if I disconnect the flashing one from Source Safe, Class View stops flashing. But I don't want to work disconnected. My Source Safe archive is on a network share that is connected, so there are no troubles accessing it.
-- modified at 9:14 Thursday 19th January, 2006
|
|
|
|
|
I want an mfc app to start autometically just after booting. which way can i do that other than saving the .exe in startup?
|
|
|
|
|
place it in the startup menu, or in the relative registry key.
there are some answers for this problem on the articles of the site.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
i want to know some other way than placing it in the start up... is there any?
|
|
|
|
|
|
put your app path here in the registry
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
-Prakash
|
|
|
|
|
|
So why not put a shortcut to your app in the Startup folder, rather than the app itself?
Shraddhan
|
|
|
|
|
How to read an ascii matrix from file?
The bigger problem is that I don't know the columns and rows number.
So I have to read the data (fscanf) but at the same time I have to catch the carriage-return (but fscanf can't help me!!)
Another question:
I have a function, for this, that works well but only with known matrix dimension;
it use fscanf and FILE object. Is possible to do the same using CFile and/or CString? (i.e. there is a cast from CFile to FILE?)
Thanks
Have a nice code day
|
|
|
|
|
well, don't use fscanf, read one line at a time, one "column" at a time.
I assume that you know the delimiter for each column, so use strtok to get each item for a line; add it to your matrix.
you could also pre-process your file, count the number of columns in the first line ( all lines have the same number of elements ? ) and count the number of lines in the file, then allocate your matrix with those numbers and re-read the file.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thank you,
you gave me very good ideas
Have a nice code day
|
|
|
|
|
_Russell_ wrote: ...but at the same time I have to catch the carriage-return (but fscanf can't help me!!)
Sure it can. Why would you think otherwise?
_Russell_ wrote: Is possible to do the same using CFile and/or CString?
Certainly.
_Russell_ wrote: (i.e. there is a cast from CFile to FILE?)
Why bother using a CFile object then? In any case, no such conversion exists.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Hi David,
DavidCrow wrote: Sure it can
let me understand: is there a way (using fscanf) to read a number from file and at the same time know if the CR is passed ?
Please, be more clear, and all my problems are solved.
Thanks for your help
Have a nice code day
|
|
|
|
|
_Russell_ wrote: is there a way (using fscanf) to read a number from file...
Yes.
int num;
FILE *pFile;
fscanf(pFile, "%d", &num);
_Russell_ wrote: ...and at the same time know if the CR is passed ?
What exactly do you mean by this? If you wish to read a line of text from a file, including the newline character, use fgets() .
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Here's one way to do it with STL (I know you asked for MFC, sorry). It doesn't actually store anything but it shows the basic structure.
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
using namespace std;
int main(int argc, char* argv[])
{
ifstream fs("C:\\a.txt");
string line;
while ( getline(fs, line) )
{
stringstream ss(line);
string word;
while ( ss >> word )
{
cout << word << " ***END OF WORD*** ";
}
cout << "***END OF LINE***" << endl;
}
return 0;
}
Nice and clean and it works on any system with a standard compliant C++ compiler.
Steve
|
|
|
|
|
Thank you friends
I solved it!
Have a nice code day
|
|
|
|
|
Does anybody know how to assign a TCHAR* fromo a LPTSTR.
This is my code:
p->shi502_netname ="test";<br />
LPTSTR h =p->shi502_netname ;<br />
TCHAR* var = h;<br />
<br />
cout<<var<<endl;
output: t
when I try to print out h i get the first letter of string pointed to by h;
I thing im no accessing the string from the pointer correctly
Kelvin Cikomo
|
|
|
|
|
kelprinc wrote: p->shi502_netname ="test";
_tcscpy(p->shi502_netname, _T("test"));
I think you should copy _T("test") to "p->shi502_netname".
Now it should work.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|