472,969 Members | 1,505 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,969 software developers and data experts.

DOS to Windows

I have a program writeen in Microsoft QC 2.5 for DOS which has a very
simple interface of using printf and sscanf also gets and puts. Is there
an easy way to convert this to Window?
Thanks
Stan
Nov 14 '05 #1
22 2062

"Stan Weiss" <sr*****@erols.com> wrote in message
news:41***************@erols.com...
I have a program writeen in Microsoft QC 2.5 for DOS which has a very
simple interface of using printf and sscanf also gets and puts. Is there
an easy way to convert this to Window?


Of topic of course, but you could just run it in a DOS window...

Nov 14 '05 #2
Stan Weiss <sr*****@erols.com> scribbled the following:
I have a program writeen in Microsoft QC 2.5 for DOS which has a very
simple interface of using printf and sscanf also gets and puts. Is there
an easy way to convert this to Window?


Try using the exact same source code. The functions printf, sscanf, gets
and puts are portable across all implementations.
However please note that the function gets is broken as designed. It is
considered impossible to use safely. You may wish to use fgets instead.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"To err is human. To really louse things up takes a computer."
- Anon
Nov 14 '05 #3
I do this now under Win 98SE and W2K but I have been told that it will
not run on XP. I do not have XP and was just looking to upgrade it. I
have Visual Studio 6 with SP5 and have only been using VB, so now was
look to move to VC++.
Stan

dandelion wrote:

"Stan Weiss" <sr*****@erols.com> wrote in message
news:41***************@erols.com...
I have a program writeen in Microsoft QC 2.5 for DOS which has a very
simple interface of using printf and sscanf also gets and puts. Is there
an easy way to convert this to Window?


Of topic of course, but you could just run it in a DOS window...

Nov 14 '05 #4

"Stan Weiss" <sr*****@erols.com> wrote in message
news:41***************@erols.com...
I do this now under Win 98SE and W2K but I have been told that it will
not run on XP.
Huh? Why not?

I do not have XP and was just looking to upgrade it. I
have Visual Studio 6 with SP5 and have only been using VB, so now was
look to move to VC++.


From VB that's a good move. Sorry I cannot help you, but my expirience with
Windows (programminG) is not as extensive as the experts of a dedicated
news-group.

I suggest you try there to get expert advice.
Nov 14 '05 #5
In article <41***********************@dreader14.news.xs4all.n l>,
dandelion <da*******@meadow.net> wrote:

"Stan Weiss" <sr*****@erols.com> wrote in message
news:41***************@erols.com...
I do this now under Win 98SE and W2K but I have been told that it will
not run on XP.


Huh? Why not?


It works. Despite what you may have heard, XP does have a "Command Prompt".

In their eternal wisdom, Microsoft keeps trying to scare people into
thinking that the "Command Prompt" (aka, "DOS Window") is going to go away
at some point, and has even managed to convince some people that it *has*
gone away in XP, but such claims are BS.

Note: It *might* be the case that some installations of XP have disabled
the ability to "shell out" (I've heard rumors to this effect - that you can
configure XP this way, but I've never seen an actual instance of it), but
even then, you should be able to run your program (i.e., the CMD.EXE is
still there, but is somehow made inaccessible to the casual user).

(All O/T, of course)

Nov 14 '05 #6
Kenny McCormack <ga*****@yin.interaccess.com> scribbled the following:
It works. Despite what you may have heard, XP does have a "Command Prompt". In their eternal wisdom, Microsoft keeps trying to scare people into
thinking that the "Command Prompt" (aka, "DOS Window") is going to go away
at some point, and has even managed to convince some people that it *has*
gone away in XP, but such claims are BS. Note: It *might* be the case that some installations of XP have disabled
the ability to "shell out" (I've heard rumors to this effect - that you can
configure XP this way, but I've never seen an actual instance of it), but
even then, you should be able to run your program (i.e., the CMD.EXE is
still there, but is somehow made inaccessible to the casual user). (All O/T, of course)


Note that ever since Windows NT, Windows doesn't have an underlying DOS
installation any more. On the contrary, Windows is the underlying
installation, and an *emulation* of DOS runs over it. For ISO standard C
programs, there won't be any difference, but attempts to use
DOS-specific features (such as bitmap graphics) might not work, or might
even crash the computer.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"No, Maggie, not Aztec, Olmec! Ol-mec!"
- Lisa Simpson
Nov 14 '05 #7
On 8 Nov 2004 17:47:56 GMT, Joona I Palaste <pa*****@cc.helsinki.fi> wrote:
Kenny McCormack <ga*****@yin.interaccess.com> scribbled the following:
It works. Despite what you may have heard, XP does have a "Command Prompt".
In their eternal wisdom, Microsoft keeps trying to scare people into
thinking that the "Command Prompt" (aka, "DOS Window") is going to go away
at some point, and has even managed to convince some people that it *has*
gone away in XP, but such claims are BS.

Note: It *might* be the case that some installations of XP have disabled
the ability to "shell out" (I've heard rumors to this effect - that you can
configure XP this way, but I've never seen an actual instance of it), but
even then, you should be able to run your program (i.e., the CMD.EXE is
still there, but is somehow made inaccessible to the casual user).

(All O/T, of course)


Note that ever since Windows NT, Windows doesn't have an underlying DOS
installation any more. On the contrary, Windows is the underlying
installation, and an *emulation* of DOS runs over it.


This is generally correct. There are some cases where the emulation is not
correct such as with sound cards, but that's another story.
For ISO standard C
programs, there won't be any difference, but attempts to use
DOS-specific features (such as bitmap graphics) might not work, or might
even crash the computer.


Dos specific features work perfectly under Windows 95 and NT. Windows XP
supports the standard VGA and VESA graphics modes without problem (although
require the program to be run full-screen). The only two things which I
know don't work under Windows would be Soundblaster emulation (and a
3rd-party fixed that), and high-resolution timers used to emulate
high-quality sound on the PC speaker.

The only significant implementation difference between Dos and Windows
would be differences in using malloc() and accessing memory just outside of
the allocated memory. This enters the realm of undefiend behaviour, but is
only important if you wonder why your program only crashes in one of the
two settings.

Nov 14 '05 #8
Raymond Martineau wrote:
[...] This enters the realm of undefiend behaviour, [...]


What a serendipitous spelling error! We have at last
learned what sort of demons inhabit the nasal passages:
they are the undefiends!

--
Er*********@sun.com

Nov 14 '05 #9
On Mon, 08 Nov 2004 09:49:39 -0500, in comp.lang.c , Stan Weiss
<sr*****@erols.com> wrote:
I do this now under Win 98SE and W2K but I have been told that it will
not run on XP.


Then you were almost certainly misinformed - if anything, XP is more
tolerant of 16-bit apps than W2K, and it even has a Win98 compatability
mode to help you further (I run several of my kids' games in this mode,
works a treat).

But this is offtopic here, and you will get authorative answers in one of
the MS groups so please ask there.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #10
On Mon, 08 Nov 2004 17:38:29 GMT, in comp.lang.c ,
ga*****@yin.interaccess.com (Kenny McCormack) wrote:
Note: It *might* be the case that some installations of XP have disabled
the ability to "shell out" (I've heard rumors to this effect - that you can
configure XP this way, but I've never seen an actual instance of it),
Security policy.
but
even then, you should be able to run your program (i.e., the CMD.EXE is
still there, but is somehow made inaccessible to the casual user).


Nope, totally inaccessible.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #11


Joona I Palaste wrote:
Stan Weiss <sr*****@erols.com> scribbled the following:
I have a program writeen in Microsoft QC 2.5 for DOS which has a very
simple interface of using printf and sscanf also gets and puts. Is there
an easy way to convert this to Window?


Try using the exact same source code. The functions printf, sscanf, gets
and puts are portable across all implementations.
However please note that the function gets is broken as designed. It is
considered impossible to use safely. You may wish to use fgets instead.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"To err is human. To really louse things up takes a computer."
- Anon


You would of course make it a console application.
Nov 14 '05 #12
Mark McIntyre <ma**********@spamcop.net> wrote:
On Mon, 08 Nov 2004 17:38:29 GMT, in comp.lang.c ,
ga*****@yin.interaccess.com (Kenny McCormack) wrote:
Note: It *might* be the case that some installations of XP have disabled
the ability to "shell out" (I've heard rumors to this effect - that you can
configure XP this way, but I've never seen an actual instance of it),


Security policy.


Myeah, but that's not XP's fault. The DOS box _is_ there, but it's
possible for the sysadmin to disable it. This is actually quite a useful
feature - can _you_ trust (all) your users with a DOS prompt?

Richard
Nov 14 '05 #13
Eric Sosman wrote:
Raymond Martineau wrote:
[...] This enters the realm of undefiend behaviour, [...]

What a serendipitous spelling error! We have at last
learned what sort of demons inhabit the nasal passages:
they are the undefiends!


Class! Uh, I mean, Struct!

--
Thomas.
Nov 14 '05 #14
First I would like to Thank every one who has responded. I do not have
XP but the person who said it did not work did have a DOS window. From
what he said it looks like the program stopped at about the point it
would have run a time function.
Stan

Stan Weiss wrote:

I have a program writeen in Microsoft QC 2.5 for DOS which has a very
simple interface of using printf and sscanf also gets and puts. Is there
an easy way to convert this to Window?
Thanks
Stan

Nov 14 '05 #15
Stan Weiss <sr*****@erols.com> wrote:
First I would like to Thank every one who has responded. I do not have
XP but the person who said it did not work did have a DOS window. From
what he said it looks like the program stopped at about the point it
would have run a time function.


Then converting to using Windows-specific output functions isn't likely
to solve the problem, is it?
Maybe your use of the time functions isn't conforming, and invokes UB.
What function would've been called, and how do you call it?

Richard
Nov 14 '05 #16
It was a couple of years ago that this happened and based on his emails
believe it happened when I called this function.

void sleep( int n)
{
timeval = time(NULL);
while ( time(NULL) < timeval + n);
}

Richard Bos wrote:

Stan Weiss <sr*****@erols.com> wrote:
First I would like to Thank every one who has responded. I do not have
XP but the person who said it did not work did have a DOS window. From
what he said it looks like the program stopped at about the point it
would have run a time function.


Then converting to using Windows-specific output functions isn't likely
to solve the problem, is it?
Maybe your use of the time functions isn't conforming, and invokes UB.
What function would've been called, and how do you call it?

Richard

Nov 14 '05 #17
On Tue, 09 Nov 2004 08:15:05 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
Mark McIntyre <ma**********@spamcop.net> wrote:
On Mon, 08 Nov 2004 17:38:29 GMT, in comp.lang.c ,
ga*****@yin.interaccess.com (Kenny McCormack) wrote:
>Note: It *might* be the case that some installations of XP have disabled
>the ability to "shell out" (I've heard rumors to this effect - that you can
>configure XP this way, but I've never seen an actual instance of it),


Security policy.


Myeah, but that's not XP's fault. The DOS box _is_ there, but it's
possible for the sysadmin to disable it. This is actually quite a useful
feature - can _you_ trust (all) your users with a DOS prompt?


If I had my way, when some of my users tried to open a dos prompt, a black
light would light up in black on a black background to tell them not to
click that button again. And then send 20 KV through the mouse, "pour
encourager les autres".

Sorry, I'm training for my BOFH exam... :-)
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #18

Stan Weiss wrote:

[repaired order]
Richard Bos wrote:
Stan Weiss <sr*****@erols.com> wrote:

First I would like to Thank every one who has responded. I do not have
XP but the person who said it did not work did have a DOS window. From
what he said it looks like the program stopped at about the point it
would have run a time function.
Then converting to using Windows-specific output functions isn't likely
to solve the problem, is it?
Maybe your use of the time functions isn't conforming, and invokes UB.
What function would've been called, and how do you call it?

Richard

[/repaired order]
It was a couple of years ago that this happened and based on his emails
believe it happened when I called this function.

void sleep( int n)
{
timeval = time(NULL);
while ( time(NULL) < timeval + n);
}


yuck! Make this

#include <time.h>

void sleep (int n)
{
time_t reftime = time(NULL);
while (difftime(time(NULL),reftime)<(double) n);
}

(untested). time_t is not necessarily an integer type.
However, there hopefully are better ways of achieving this
than polling.
Please do not top-post.
Cheers
Michael

--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #19
Mark McIntyre (or somebody else) wrote:
Myeah, but that's not XP's fault. The DOS box _is_ there, but it's
possible for the sysadmin to disable it. This is actually quite a useful
feature - can _you_ trust (all) your users with a DOS prompt?


FWIW, that is not a DOS box or DOS prompt. DOS has nothing to do with
it; it's a win32 console window.

Also FWIW, most Windows users are perectly capable of screwing up
their systems with or without the help of the command prompt in
a console window.

Allin Cottrell
Nov 14 '05 #20
In article <cn***********@f1n1.spenet.wfu.edu>,
Allin Cottrell <co******@wfu.edu> wrote:
Mark McIntyre (or somebody else) wrote:
Myeah, but that's not XP's fault. The DOS box _is_ there, but it's
possible for the sysadmin to disable it. This is actually quite a useful
feature - can _you_ trust (all) your users with a DOS prompt?

FWIW, that is not a DOS box or DOS prompt. DOS has nothing to do with
it; it's a win32 console window.


We all understand that, of course, but most people don't.

However, I'd be hard pressed to give an argument as to why the distinction
matters. I.e., it looks and feels like DOS (modulo the differences between
CMD and COMMAND shell syntax; and note that there is a Win95CMD tool that
allows you to use CMD syntax under Win95, etc [DOS based versions of
Windows]). I say this last to head off the argument that "it's not DOS
because the shell syntax is different".

And, note that many people use terminology so sloppily that they call
anything that has a "console"-ish look a "DOS prompt" (I know somebody who
refers to Unix as "a DOS window").
Also FWIW, most Windows users are perectly capable of screwing up
their systems with or without the help of the command prompt in
a console window.


Well said!

Nov 14 '05 #21
On Thu, 11 Nov 2004 22:20:22 -0500, in comp.lang.c , Allin Cottrell
<co******@wfu.edu> wrote:
Mark McIntyre (or somebody else) wrote:
Myeah, but that's not XP's fault. The DOS box _is_ there, but it's
possible for the sysadmin to disable it. This is actually quite a useful
feature - can _you_ trust (all) your users with a DOS prompt?

FWIW, that is not a DOS box or DOS prompt. DOS has nothing to do with
it; it's a win32 console window.


If we're being pedantic, command.com also isn't DOS - its the command
interpreter which runs on top of DOS. You can disable that too.
Also FWIW, most Windows users are perectly capable of screwing up
their systems with or without the help of the command prompt in
a console window.


And most of them wold fsck up their macs and linux boxes just as well. Lets
keep that to alt.advocacy.flames tho shall we?

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #22
ga*****@yin.interaccess.com (Kenny McCormack) wrote:
In article <cn***********@f1n1.spenet.wfu.edu>,
Allin Cottrell <co******@wfu.edu> wrote:
Mark McIntyre (or somebody else) wrote:
Myeah, but that's not XP's fault. The DOS box _is_ there, but it's
possible for the sysadmin to disable it. This is actually quite a useful
feature - can _you_ trust (all) your users with a DOS prompt?


FWIW, that is not a DOS box or DOS prompt. DOS has nothing to do with
it; it's a win32 console window.


We all understand that, of course, but most people don't.

However, I'd be hard pressed to give an argument as to why the distinction
matters.


In Win9x, the whole "OS" is still built on top of (some kind of) MS-DOS.
Cause creative enough Undefined Behaviour in a DOS application and
you'll be able to crash the entire system. (I know; I've done it :-/ )
In contrast, in XP the command prompt is a separate application within
Windows. Crashing an XP console box shouldn't crash the whole computer;
it should merely lock it tight :-P

Richard
Nov 14 '05 #23

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
7
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> How can I get the users (client) IP-Address ? I...
7
by: Tyler Foreman | last post by:
Hello, I have a strange problem that occurs every so often in my application. It usually takes place when I hide one form and activate another. What happens is I get the following exception:...
1
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. I'm having trouble getting the code that I've written to work, can anyone shed some light as to where I'm...
0
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. The program I'm trying to develop needs to be able to do the following: - Select remote server -...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
2
by: sambo251 | last post by:
After running a few updates I get this very annoying "Windows Installer" error #1706 that will ne go away! It keeps saying that it cannot find the file "instantsharedevices.msi", that it is on...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
3
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.