|
I don't know how to get the data from a normal excel file but I do know why your outfile code worked and your infile code doesn't...
Your ftest.out file would be considered a csv file (comma seperated values) and excel supports csv. A normal excel file is not stored in csv format.
Sorry I don't really have an answer but at least you know it isn't some little bug in your code.
There are a few articles here on codeproject dealing with excel files, maybe you could find an answer there... try here for instance
-Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|
I haven't tried it, but generally, if you export the Excel file in ASCII or .csv format (whichever it offers you as an option) the result will be a comma-separated text file. You can then read it as char data and parse the fields using the commas as end-of-field indicators. I believe there's a tokenizer function that does this, but I'm far from my MSDN library right now. Check there online for "token" or some such.
|
|
|
|
|
How do I export the Excel file in ASCII or .csv format? Do you mean that this is an option in the excel program itself, or do you mean that visual C++ has the ability to do this to the file? If its an option in excel itself, could you tell me how to go about exporting the file?
|
|
|
|
|
I don't use Excel, though several at work do, so I'm not certain how to do it. But I believe I found it once in the File menu. Check there for an Export option; it should offer you a set of format selections, including text (aka ASCII, or CSV). If it's not there, check the online Help for "Exporting." Every other spreadsheet program since Calc has had this option, so I doubrt that it's been left out.
A potential problem might come up when using multiple sheet spreadsheets - it may export only one sheet - you'll need to manually review the resulting file to see what you've got.
|
|
|
|
|
There is (was) an "Excel Developers Kit" (book) that at least went through the 97 version.
Good ideas are not adopted automatically.
They must be driven into practice with courageous patients. -Admiral Rickover. ...
|
|
|
|
|
You may consider using the getline method:
ifstream infile("ftest.in");
char[81] myText;
for(int i = 0;!infile.eof;i++)
{
myText = infile.getline(myText);
}
Hope something like this helps.
Nick Parker
|
|
|
|
|
My goodness - is this homework, or does your boss want it ? It reads like you've typed in a spec from an assigment or work request.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Christian Graus wrote:
is this homework
Good call....
Nick Parker
|
|
|
|
|
I'd love to know where, I'd love to do a course that gives homework this in depth. But it's obviously been typed in from some sort of assignment description.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
help with downloading from a login/pass web using php Anonymous 12:48 17 Mar '02
hi, i would like to do something like that:
the website targeted use php to login with a username and a password.
and then, some menu is shown, (all using .php or .php3 extension for viewing pages.)
the fact is, if i do not log with my user/password within internet explorer, i can't even retrieve files i want using internet explorer.
but, even after logging in, and when i am able to download any file ending with .php3?someparam=somevalue&another=anothervalue etc...
when i use a offlinebrowser application to save all pages i want, the external application finally download a page which says i'm not logged on. although i can still download that page opening an internet explorer windows... (and setting the offline browser 'spider' to identify itself as IE doesn't solve the problem.)
so i have figured out that i need something, which will log in using a specified username/password, and then, will download all files linked from a single url. (and that need to work with either .php or .php3?x=1&pass=2 files...)
how can i do that?
|
|
|
|
|
I have a OnEraseBkgnd() function to change the background colour of my MDI app's frame window to a nice blue colour rather than boring grey... but every permutation of my attempts to do so don't work..
Can somebody please tell me the correct code for changing the background? I have this so far, but does not work:
BOOL CMainFrame::OnEraseBkgnd(CDC* pDC)
{
// Paint it a nice colour.
CBrush backBrush(0x00755121);
// Save old brush.
CBrush* pOldBrush = pDC->SelectObject(&backBrush);
CRect rcRect;
pDC->GetClipBox(&rcRect); // Erase the area needed.
pDC->PatBlt(rcRect.left, rcRect.top, rcRect.Width(), rcRect.Height(), PATCOPY);
pDC->SelectObject(pOldBrush);
return TRUE;
}
Thanks
|
|
|
|
|
I believe the problem is that you need to do this elsewhere to get the background of an MDI app. I forget exactly where, but my recollection is an article on this was posted recently.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Your code is correct for painting over a background. However the reason that it does not appear is because your MDI frame window, contains an MDI client window. This is where you will need to handle the erase background message.
You will have to sub class that window in order to handle that message. The MDI frame provides a variable m_hWndMDIClient that represents that handle of that window.
|
|
|
|
|
This is what you want:
http://www.codeproject.com/useritems/MDIBackgroundImage.asp
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I've Windows XP, VC + SP5
I've installed (windowsxp.x86.fre.rtm.symbols.exe) but when I debug my application still they are not found:
[...]
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
[...]
But "C:\WINDOWS\SYMBOLS\DLL\ole32.pdb" exists, it's been installed by the exe above.
I heard about a problem with 'pdb' files and about some changes to do in the registry under DevStudio but I don't remember more
Any help?
Thanks in advance.
|
|
|
|
|
Chances are you have applied a OS patch the XP and the OLE32.PDB doesn't match the DLL anymore.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hi,
I was wondering how you would do a proper scrolling in a CScrollView
when you perform search and find and highlighting for characters? I mean there are ways to force the vertical scrollbar to move up and down, but how
do you make sure that it moves up and down only when it's necessary
(only when the item is outside of the current screen)?
|
|
|
|
|
CRect rcClient;
GetClientRect(&rcClient);
TEXTMETRICS tm;
CDC* pDC = CDC::FromHandle(::GetDC(this->m_hWnd));
pDC->GetTextMetrics(&tm);
int nLineHeight = tm.tmHeight (I think) + tm.tmAscent; (i think)
The above code would work on constant font size, but you would have to figure something else out if you have graphics and such or font's of different sizes.
Basically once you have individual line height and client area figured out, you would need to determine which line the word (found) was located.
int iLine = Search("Test");
Now that you have the line index:
int nSpace = iLine * nLineHeight;
nSpace is the number of pixels all the lines up to the current indexed line consume.
By having this value and having you current viewing area(client rect) you could subtract client area by line height(s) and determine if the text is out of the viewing area and requires scrolling.
if(nSpace >= rcClient.bottom)
{
}
else
AfxMessageBox("Don't scroll...Text is within current area");
I'm missing a few thing i'm sure, but from the above you should get the gist of things and be able to take it one step further.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi,
Is there any classes or ActiveX control that can make my appl time trial? And what about adware?
Thank u very much,
Dirso.
|
|
|
|
|
This stuff is easy to do and the only solution is to roll your own. I mean, if a common class exists to do a time trial, doesn't that mean by figuring out how to break it, someone can in one stroke crack every program that uses it ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
|
Have you seen the guys photo on that artice ? Would you trust someone who looks like that to write code for - oh, sorry, Nish ..... :P :P :P :P :P :P :P
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Christian Graus wrote:
Have you seen the guys photo on that artice ? Would you trust someone who looks like that to write code for - oh, sorry, Nish .....
Yeah, you'd have thought he was a model or a film actor going by his good looks eh?
Nish
Make MSDN universal, FREE!
|
|
|
|
|
Yeah - that's what I meant. Always hard to take those good looking people seriously.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Thank u very much!!!!! Ur work is really GREAT!!!! It's not a 5 it's a BIG 1000!!!
Dirso
|
|
|
|