This works fine when I compile it with the old MS C 6.0
This does not work with MS Visual C++ 4.0 and MS Visual C++ 5.0.
Why? Please help!
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Chris M.
July 9th, 1999, 09:39 AM
ansi.sys needs to be in your C:\config.sys file
You need to have the%2
Ed Johnson
July 9th, 1999, 10:11 AM
Please, no more "Do you have your ANSI.SYS loaded?" replies.
This is NOT the problem, as I said if you read the message. I works with MSC 6.0
but not Visual C++. Obviously ANSI driver support is loaded.
Again, why does Visual C++ send characters directly to the console and not through the ANSI
driver?
Please, someone who know the answer reply.
Thanks!
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Paul McKenzie
July 9th, 1999, 04:00 PM
Did ANSI.SYS hook interrupt 10H? If it did, and VC++ does not print through int 10H, this may be the answer. You can trace through the source code to see eventually where the characters are going.
Regards,
Paul McKenzie
Chris M.
July 10th, 1999, 08:35 PM
I absolutely can't believe the moronicness of your reply. I hate to be
an nasty but...
I just aggravates me to no end when someone who has no concept of the
problem offers
and idiotic suggestion such as your. You make others thing, oh, problem
solved, I guess
I won't give this any more thought, you make yourself look stupid and
you don't help me.
1) If you read the message you would see that the MSC 6.0 version works,
duh!
I guess ANSI.SYS is loaded.
2) There is no config.sys in Windows NT.
Thanks for the info. I have never used NT, but I have used a quite a bit of dos and window 95. - (If its any consolation)
I am not trying to start a war, that is why I am sending you this in a
private message.
It might as well be public. It will be more benficial being public.
Just keep your mouth shut if you don't know the answer.
I'll bet you
were one of those kids
in school that yell out the wrong answer without raising his hand.
Sorry, can't say that I ever was one of those people.
P.S. Sorry for being so nasty but you really pissed me off.
If you were really sorry...why bother to write a rude letter? Your not sorry. I am sure you enjoyed it. Its human nature.
I just thought I would offer some assistance. If you helps you great. If it doesn't don't worry about it. I have a real hard time believing you have never made a mistake or accidently given someone the wrong advice. Its sometimes hard to see yourself out of the same lense you look at other people with.
By your responce, I would say that you are in a extreem frustration, and you have a great, great deal of pride and arrogance. (Why would a fool such as myself attempt to answer the question of a great master? =( ) Maybe you should deal with the pride and arrogance first, before trying to find a programming solution.
You are partialy right, however. I just quickly scanned your post hoping you made a simple mistake that I could help you out with. I am only 20 and still learning and growing. Perhaps I can help you with something in the future...or maybe you could help me out instead. I will learn from this. Thanks for the lesson.
I hope you find and answers to your questions.
- Chris
--
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Ed Johnson - mailto:johnsone@softhome.net
Ed Johnson
July 12th, 1999, 06:19 AM
I think you have proven my point.
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Ed Johnson
July 12th, 1999, 06:25 AM
That's a very interesting theory. I would think that printf() and ANSI.SYS should be written to work
together. Anything less I would consider a bug in the C++ compiler or the ANSI driver. If you are
correct, how can we get a fix? Why would MS drop support for ANSY.SYS? Would'nt that be a
requirement, (to be ANSI compatable)?
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Ed Johnson
July 12th, 1999, 08:40 AM
"Did ANSI hook int 10h?" You mean you don't know? Please no more guesses.
I need a factual answer from some one who KNOWS the answer. While this question
may seem simple on the surface. Its not a question the unknowledgeable should attempt with
quippy answers.
Thanks anyway.
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Paul McKenzie
July 12th, 1999, 11:53 AM
The only way that a system driver like ANSI.SYS could work would be to hook the interrupts that write to the screen. Unless you know of any other method, this is the only method that I'm aware of.
The simplest thing is to look at the RTL source for printf(). Somewhere, it will call one of the basic console I/O functions. Within that function is where the difference lies between what is occurring between the versions of VC++.
As to the nature of your responses:
CodeGuru is not Microsoft's Technical Support Line. Your response to me seems a bit out of whack. If you really wanted to know the answer to this, you could have done what I suggested and see if it is the case. If it's not the case, you can let me know in a less abusive manner.
Unknowledgable? I've been doing this a long time now (20 years and an adjunct CS professor at a major university), maybe you have too. The difference between you and I is that I will attempt to take every suggestion and investigate and explore if I do not know the answer myself, and not wait for the "magic bullet" answer on an Internet discussion board.
Regards,
Paul McKenzie
Rail Jon Rogut
July 12th, 1999, 02:17 PM
Well.... I just tested the following code under VC++ 5.0
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("Test");
printf("%c[2J", 27); //clear the screen
printf("Test\n");
getchar();
return 0;
}
and it works perfectly when ANSI.SYS is loaded (the same code works under VC++ 6 as well on a separate system)... so that would all lead us to wonder what's wrong with your system? The obvious first thought would be that you're an idiot and you didn't have ANSI.SYS loaded... if that's not the case, then I don't know... I'd definately look into some of the console functions such as SetConsolMode.
Which OS are your running (just curious)?
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
railro@earthlink.net
http://home.earthlink.net/~railro/
I am running: Windows NT Version 4.0 Build 1381 Service Pack 4.0
To all you Windows 95/98 users...
FYI: Windows NT does NOT use a config.sys.
Even if it did, How would you explain the MCS 6.0 version working with out ANSI.SYS loaded?
You solutions so far...
"ANSI.SYS needs to be loaded" - (Obviously it it loaded if MSC 6.0 version works.)
"ANSI.SYS needs to be in your c:\config.sys" - (What if I my config.sys is on d:?)
"It works on my machine" - (Thank you, I guess that fixes it.)
"Look through the source" - (I did, dead end, the low level code is not there)
Please forgive my abrasivness, but no answer given has solved the problem so far...
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Ed Johnson
July 13th, 1999, 04:55 PM
This batch file does'nt work either...
@echo off
echo {esc}]2J
Which leads me to ask, how does one check for the ANSI driver being loaded in NT?
And how do you load it since it does NOT use a config.sys file?
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Rail Jon Rogut
July 13th, 1999, 06:44 PM
Well it wasn't hard to find on the web...
http://www.nthelp.com/40/ansiNT.htm
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
railro@earthlink.net
http://home.earthlink.net/~railro/
Rail Jon Rogut
July 13th, 1999, 11:57 PM
You also may want to check out Q100394 and Q101875, the latter being on the net at http://ftp://ftp.microsoft.com/bussys/winnt/kb/q101/8/75.txt.
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
railro@earthlink.net
http://home.earthlink.net/~railro/
Steve Dwire
July 14th, 1999, 08:34 AM
At the risk of getting toasted by Mr. Johnson, I will hazard a guess at the answer. I realize Mr. Johnson is tired of guesses, but I believe this guess is an educated one.
With MS C 6.0, what you created was a DOS application, which uses a config.sys file (or some equivalent thereof) even in Windows NT. With Visual C++ 4+, you're no longer creating a DOS application, you're creating a 32-bit console application, which is a different beast.
Apparently, a 32-bit console application does not support ANSI sequences, while a character-mode DOS application still does. Why doesn't a console application support ANSI? I can't answer that one. How do you convince it to support ANSI? I can't answer that either. But I believe my explanation about why it works with MS C 6.0, but does not work with Visual C++ 4+ is correct.
S_E_D
Paul McKenzie
July 14th, 1999, 09:51 AM
In MSVC on-line help:
------ Begin Excerpt ----
"MSVC/MSDN Article ID: Q101875
How to Enable ANSI.SYS in a Command Window
Last reviewed: October 6, 1997
Article ID: Q101875
The information in this article applies to:
Microsoft Windows NT versions 3.1, 3.5, 3.51, *4.0* <<---- Will this help?
....
"
---- End Excerpt ----
Regards,
Paul McKenzie
Ed Johnson
July 14th, 1999, 04:42 PM
Thank you but, no that does not help.
I cannot find the article you are refering to.
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Gomez Addams
July 14th, 1999, 04:47 PM
Try this link : http://support.microsoft.com/support/kb/articles/q101/8/75.asp
Ed Johnson
July 14th, 1999, 04:56 PM
I am linking to the protect mode libraries in MSC 6.0 not the real mode.
When running CMD.EXE it works.
If I run COMMAND.COM is gives me an error.. "This program cannot be run in dos mode."
Therefore, I am running NOT in a real mode window, but a 32bit CMD Window.
What sayist thou to that?
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Ed Johnson
July 14th, 1999, 04:57 PM
That'f fine if you are running in a command.com 16bit window.
What about support for a CMD.EXE 32bit window?
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Ed Johnson
July 14th, 1999, 05:10 PM
You win! You are so helpful. Thank you! THAAAANK YOOOOU!!!
I see, as I suspected, there is a big whole in the Win32 Console App. from your most excellent help!
http://support.microsoft.com/support/kb/articles/q101/8/75.asp
"Windows NT does not support ANSI escape sequences in Win32 Console applications."
Thanks you Microsoft (Bill Gates), you F'd me again, nice job, ouch! It must be nice to be you...
Have you been to my home page lately?
Home page: http://www.geocities.com/SiliconValley/Hills/5230/index.htm
Gomez Addams
July 14th, 1999, 05:39 PM
Have a look at the console API. You can do nearly everything
with it that you could with the escape sequences.
There is a wrapper class on this site here :
http://www.codeguru.com/misc/console.shtml
VC also has a fairly good sample called console that
demonstrates the possibilities. Good Luck.
Rail Jon Rogut
July 14th, 1999, 06:04 PM
What I find amazing, is that it took me all of maybe 5 minutes to locate this information on the internet and in the MSDN info... Perhaps if you'd actually looked for any of this information yourself, instead of relying on strangers to do your legwork - you wouldn't be quite so cranky. Even after I gave you the Q numbers associated with the relevent Knowledge Base Articles, you weren't able to find them without someone actually having to show you where to look for it.
Perhaps before you get so upset with everyone here and Mr. Gates, you should look inward at your own faults... and rather than expecting everyone else to do your work for you -- do a little research yourself.
Yours sincerely
Rail Jon Rogut
Recording Engineer/Software Developer
Rail Jon Rogut Software
railro@earthlink.net
http://home.earthlink.net/~railro/
Paul McKenzie
July 14th, 1999, 07:34 PM
Technically I win. The article that I told you about is the very same article that Gomez directed you to look at. All you needed to do was open the VC 6.0 help, enter "Q101875" in the Search, and you would have found the article. You didn't even have to get on the Internet to find it. Unless you have a bootlegged copy of the VC 6.0 CD by itself and not the full package, this info was just a few mouse-clicks and keystrokes away.
Regards,
Paul McKenzie
Steve Dwire
July 15th, 1999, 08:21 AM
This thread has already concluded that Win32 console applications do not support ANSI escape sequences. If the application MSC6.0 built DID support ANSI, then it must not have been a Win32 console application. Exactly what kind of application it built will, of course, depend on your project settings, but I believe we can safely conclude that it was not a Win32 console application. The only other kind I know of is a character-mode DOS application (whether real or protected). Is it possible that MSC6.0 generated a 32-bit, protected-mode DOS application for DPMI when you linked to protected-mode libraries?
I'll admit. There are some weak links in my logic, so my conclusion may be faulty. But even the knowledgebase article hasn't explained why your original application worked.
S_E_D
July 16th, 1999, 08:37 AM
You really sound gay
July 16th, 1999, 08:40 AM
chiuyan
July 16th, 1999, 09:16 AM
I was hoping this kind of drivel would stay out of this forum. Maybe codeguru needs to stop allowing Anonymous postings (I believe that would help eliminate this kind of garbage).
--michael
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.