Board index » cppbuilder » Writing programs for Win NT 4.0

Writing programs for Win NT 4.0

Can I use C++ builder professional to write programs that will run on
Windows NT 4.0? Thanks.

--
Richard B. Hall, Software Design Team (ED14)
544-3789 (voice)
544-8480 (fax)
richard.b.h...@msfc.nasa.gov

 

Re:Writing programs for Win NT 4.0


Richard,

I answer with a resounding "YES!"

I am doing so now and have been for the past year...

--Samuel Grant

Quote
Richard Hall <richard.b.h...@msfc.nasa.gov> wrote:
>Can I use C++ builder professional to write programs that will run on>Windows NT 4.0? Thanks.

>--
>Richard B. Hall, Software Design Team (ED14)
>544-3789 (voice)
>544-8480 (fax)
>richard.b.h...@msfc.nasa.gov

Re:Writing programs for Win NT 4.0


Richard,

Of course! Builder can only produce programs that run under the Win32
API and one of the major features of Windows NT is that it implements
the full Win32 API.

FWIW Builder created applications can also usually run under Win9x
because those versions implement most of the Win32 API.

Similarly Builder programs can run under Win2K. As far as we can tell
any program that runs under WinNT will run under Win2K.

Having said all that it is possible to develop an application which
will only run on Win9x or WinNT but not both. Usually this will be
because of something you are choosing to do (such as calling a
function that Win9x doesn't implement or allocating too many
resources for Win9x or performing direct hardware access [forbidden
under NT]).

The bottom line is that Builder was designed to create programs for
Win32 and that means WinNT, Win9x and Win2K.

Andrue Cope
[Bicester, UK]

Re:Writing programs for Win NT 4.0


I hope you are right about this, but I forgot to mention that I am
presently using the 1997 version of Builder Professional. When I
recently wrote a program on my Win 98 machine and tried to run the .exe
file on the Win NT 4.0 machine, I got a small error box that told me
bascially nothing about what was wrong. Got any ideas?

Quote
Andrue Cope wrote:

> Richard,

> Of course! Builder can only produce programs that run under the Win32
> API and one of the major features of Windows NT is that it implements
> the full Win32 API.

> FWIW Builder created applications can also usually run under Win9x
> because those versions implement most of the Win32 API.

> Similarly Builder programs can run under Win2K. As far as we can tell
> any program that runs under WinNT will run under Win2K.

> Having said all that it is possible to develop an application which
> will only run on Win9x or WinNT but not both. Usually this will be
> because of something you are choosing to do (such as calling a
> function that Win9x doesn't implement or allocating too many
> resources for Win9x or performing direct hardware access [forbidden
> under NT]).

> The bottom line is that Builder was designed to create programs for
> Win32 and that means WinNT, Win9x and Win2K.

> Andrue Cope
> [Bicester, UK]

--
Richard B. Hall, Software Design Team (ED14)
544-3789 (voice)
544-8480 (fax)
richard.b.h...@msfc.nasa.gov

Re:Writing programs for Win NT 4.0


Richard,

Quote
> I hope you are right about this

I am <s>.

Quote
> I got a small error box that told me
> bascially nothing about what was wrong. Got any ideas?

Without knowing what the message was I don't stand much chance of
answering that do I <S>?

As I said in my previous posting it is possible for *you* to create a
program which can't run under NT4. These are two "off the top of my
head" ways how you could do this:

  1.Develop a program that uses DirectX 4 or higher.
  NT4 doesn't support this.

  2.Develop a program which directly accesses or manipulates hardware
I/O ports. NT4 (and FWIW Win2K) don't allow this.

Neither of these are Builder faults - they are both caused by the
programmer. The first is the result of using an API call which is not
supported on all versions of Windows. The second is the result of
obsolete and (IMHO) bad programming practice.

The bottom line is that Builder creates Win32 programs it's just that
"Win32" is a bit of a movable feast and different versions of Windows
support different bits of it in different ways.

Andrue Cope
[Bicester, UK]

Re:Writing programs for Win NT 4.0


Andrue,

You have given me an idea that may help me solve the problem. I have
been using some older functions, like fopen, fgets, fputs, and fclose,
for file access and manipulation. Are these functions perhaps only
16-bit functions? I checked on their portability in Builder, and it
indicates they can be used with both 16-bit and 32-bit applications. I
just found one, called TFileStream that I hope is for 32-bit programs.
What do you think?

Quote
Andrue Cope wrote:

> Richard,

> > I hope you are right about this

> I am <s>.

> > I got a small error box that told me
> > bascially nothing about what was wrong. Got any ideas?

> Without knowing what the message was I don't stand much chance of
> answering that do I <S>?

> As I said in my previous posting it is possible for *you* to create a
> program which can't run under NT4. These are two "off the top of my
> head" ways how you could do this:

>   1.Develop a program that uses DirectX 4 or higher.
>   NT4 doesn't support this.

>   2.Develop a program which directly accesses or manipulates hardware
> I/O ports. NT4 (and FWIW Win2K) don't allow this.

> Neither of these are Builder faults - they are both caused by the
> programmer. The first is the result of using an API call which is not
> supported on all versions of Windows. The second is the result of
> obsolete and (IMHO) bad programming practice.

> The bottom line is that Builder creates Win32 programs it's just that
> "Win32" is a bit of a movable feast and different versions of Windows
> support different bits of it in different ways.

> Andrue Cope
> [Bicester, UK]

--
Richard B. Hall, Software Design Team (ED14)
544-3789 (voice)
544-8480 (fax)
richard.b.h...@msfc.nasa.gov

Re:Writing programs for Win NT 4.0


Richard,

Quote
> fopen, fgets, fputs, and fclose

These are part of the C++ language standard and work fine under
Builder. The only problems are that you can't easily use them to
access files bigger than 2GB but that shouldn't cause AVs - it just
means your seeks() don't go where you expect them to <s>.

Andrue Cope
[Bicester, UK]

Re:Writing programs for Win NT 4.0


Hi,
recompile your program in NT.
This may not be the cause, but sometimes a program will need to be
recompiled before it will work in NT.

Rob

Quote
Andrue Cope wrote:
> Richard,

>> fopen, fgets, fputs, and fclose

> These are part of the C++ language standard and work fine under

> Builder. The only problems are that you can't easily use them to

> access files bigger than 2GB but that shouldn't cause AVs - it just

> means your seeks() don't go where you expect them to <s>.

> Andrue Cope

> [Bicester, UK]

Re:Writing programs for Win NT 4.0


Quote
Andrue Cope wrote:

> Richard,

> > fopen, fgets, fputs, and fclose

> These are part of the C++ language standard and work fine under
> Builder. The only problems are that you can't easily use them to
> access files bigger than 2GB but that shouldn't cause AVs - it just
> means your seeks() don't go where you expect them to <s>.

More info please.  I am getting exactly this problem.   Program runs for
ages and then crashes on a seek that exceeds 2 gig.

Why can't the standard functions support 2+gig seeks?

How do I work around this problem?  If possible is there a 'portable'
way that works on Unix as well.

KenF

Re:Writing programs for Win NT 4.0


Ken,

Quote
> Why can't the standard functions support 2+gig seeks?

Because the standard defines them as accepting an 'int' which has a range
of +/- 2GB. Under Win16 you could use the negative range to go as far as
4GB (in affect the API implemented the function using a DWORD. This is
nolonger the case and -ve values will generate an error unless you are
performing a relative move.

Quote
> How do I work around this problem?

You could try performing relative position changes (I have no idea if
this will work) but the solution we use is to call the API directly. Look
up CreateFile() and SetFilePointer().

Andrue Cope
[Bicester, UK]

Re:Writing programs for Win NT 4.0


The are several functions buint into C++Builder which allow
manipulationg VERY large files.
Instead of using seek use FileSeek.

Tom Woodrow

Other Threads