VC++ and WinNT Problem

R

Raveen.B

hi all,

i have MSVC Project which was developed on Win 98 (quiet antique but
true), now i move the development to Win NT. when i runt the
application it fails with a message, "unable to create new document".
what could be the causes of this error? but the same application if
run in win 2k or XP is running fine.

thanks
Ravs
 
J

John Harrison

Raveen.B said:
hi all,

i have MSVC Project which was developed on Win 98 (quiet antique but
true), now i move the development to Win NT. when i runt the
application it fails with a message, "unable to create new document".
what could be the causes of this error? but the same application if
run in win 2k or XP is running fine.

Questions about Windows programming should be asked on a Windows programming
group, like
This group is for C++ questions and your question has nothing to do with
C++.

john
 
H

Howard

Raveen.B said:
hi all,

i have MSVC Project which was developed on Win 98 (quiet antique but
true), now i move the development to Win NT. when i runt the
application it fails with a message, "unable to create new document".
what could be the causes of this error? but the same application if
run in win 2k or XP is running fine.

thanks
Ravs

I think that NT (4.0) is as old as 98, if not older. (But who can remember
back that far? :)) And it was a very different OS from 95, 98, 2000 or XP.
You have to compile explicitly for the NT in most cases, and sometimes even
rewrite the code to work with the NT. Want advice? Drop NT, it's lifetime
is over.

-Howard
 
A

Alf P. Steinbach

* Howard:
I think that NT (4.0) is as old as 98, if not older. (But who can remember
back that far? :)) And it was a very different OS from 95, 98, 2000 or XP.
You have to compile explicitly for the NT in most cases, and sometimes even
rewrite the code to work with the NT. Want advice? Drop NT, it's lifetime
is over.

Off-topic except the degree to which C++ development is influenced by
system support might be sort of on-topic, e.g. NT provides better
checking of invalid pointer usage.

<OT>
The Explorer GUI was introduced in Windows 95 and subsequently made
available on Windows NT, then in version 4. Windows 2000 is NT 5.0,
Windows XP home and professional is NT 5.1, and XP Server is 5.2.
It's a bit difficult to drop NT for Windows programming since it's
the current Windows.
</OT>
 
J

JKop

Up until WinXP, all home editions of Windows were ASCII
while the office editions were Unicode. Both operating
systems have:

MessageBoxExA
MessageBoxExW

But on the home editions, the W one is a dummy. While on
the office editions, both work. Consequently, WinNT progs
simply *won't* work on normal Windows 98, but Win98 progs
*will* run on WinNT.

Now, with WindowsXP, everything's Unicode. If you call an A
function, then:

blah AFunction(blah)
{
Convert();
WFunction();
}

This is the opposite of how WinNT dealed with Win98 progs.

-JKop
 
M

Mike Smith

JKop said:
Consequently, WinNT progs
simply *won't* work on normal Windows 98, but Win98 progs
*will* run on WinNT.

Not only is this off-topic, it's patently false. The default use of
ANSI vs. Unicode API calls is determined by the compiler, not by the OS.
If you #define UNICODE then the API calls resolve to Unicode
functions, otherwise they resolve to ANSI functions. It is entirely
possible to build Win32 executables that will run as-is on everything
from Win95 through Longhorn.
 
J

JKop

Mike Smith posted:
Not only is this off-topic, it's patently false.
False.

The default use of
ANSI vs. Unicode API calls is determined by the compiler,
not by the OS.

False, it's determined by which you call.

MessageBoxA
MessageBoxW

There's no such Win32API function "MessageBox". It's very
possible that you possess a certain header file that maps
MessageBox to MessageBoxW via a macro or a function.
If you #define UNICODE then the API calls resolve to Unicode
functions, otherwise they resolve to ANSI functions.

....with a certain header file.
It is entirely
possible to build Win32 executables that will run as-is on everything
from Win95 through Longhorn.

It's very possible to do so with any Win32 compiler.
Compile a Win32 program that uses a function like:

GetWindowTextW

Run the program on Win95 -> Win Millenium

The function will not do anything and the return value
won't mean anything, it's a dummy.

Run it on Win NT 4 -> Win 2000

It will run perfectly.

There's but one "W" function that will function on Win95 ->
Win Millenium and that's "MessageBoxW".

As for Windows XP. All versions of it have functional W and
A functions, although the A functions just perform a
conversion and call the W version, because WinXP is
Unicode. This is exactly what Windows NT did when you
called an A function.

-JKop
 
M

Mike Smith

JKop said:
Mike Smith posted:



progs *will* run


not by the OS.

False, it's determined by which you call.

MessageBoxA
MessageBoxW

There's no such Win32API function "MessageBox". It's very
possible that you possess a certain header file that maps
MessageBox to MessageBoxW via a macro or a function.

Uh, yeah, and that's how the Win32 SDK has come ever since NT 3.1, so I
didn't think it was worth mentioning - i.e. any decent Windows
programmer *knows* that already.
...with a certain header file.

Uh, yeah - the one supplied *by Microsoft* for *their* OS, since the
early '90s.
It's very possible to do so with any Win32 compiler.
Compile a Win32 program that uses a function like:

GetWindowTextW

Run the program on Win95 -> Win Millenium

The function will not do anything and the return value
won't mean anything, it's a dummy.

Run it on Win NT 4 -> Win 2000

It will run perfectly.

There's but one "W" function that will function on Win95 ->
Win Millenium and that's "MessageBoxW".

As for Windows XP. All versions of it have functional W and
A functions, although the A functions just perform a
conversion and call the W version, because WinXP is
Unicode. This is exactly what Windows NT did when you
called an A function.

And using the ...A() version of the function, with ANSI strings, will
perform correctly on all Windows versions, like I *said*.
 
J

JKop

Mike Smith posted:
And using the ...A() version of the function, with ANSI strings, will
perform correctly on all Windows versions, like I *said*.


Back in the day, if one wanted to write a thoroughly
efficent prog for WinNT, they'd use the W functions. The
resulting executable wouldn't do anything on Win95 -> Win
Millenium.

End of discussion.

-JKop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top