How can I target Windows 98? - windows

I have a pressing need to develop an application for Windows 98, and do not have the option of using a different operating system. In this day and age, is there any modern SDK that I can use to develop the application? What would be awesome, is if there was some way to target Windows 98 from Visual Studio 2015 but as far as I know there is no way of doing this.
Can I write and compile an application for Windows 98 using Visual Studio 2015? If not, then what is my next best option?

I assume you are writing native code: Windows 98 uses the Win32-API, like XP and modern Windows versions too. Some things are different, e.g. APIs like VirtualAllocEx() are missing. If you avoid these APIs (https://msdn.microsoft.com has a minimum requirements section for each API) and write native code, your program should run on Windows 98 too. If you have problems with Visual Studio, you can use good old gcc and an IDE like Eclipse, Code::Blocks, etc. Just make sure you don't compile it for the 64-bit plattform. Otherwise you will get a PE+ binary which won't run on Windows 98.
EDIT:
According to the discussion in the comment sections a few updates: Although a PE for 32-Bit (compiled on a modern Windows box) is compatible to Windows 98, there might be problems with Visual Studio due to its runtime library. As an alternative, you could try to
compile without runtime
use MingW as it uses msvcrt.dll
Nevertheless, it is still tricky to check which Windows version supports certain APIs due to updates in the MSDN. An older copy of the MSDN could help at this point.

Related

Qt development in windows. Do I need pay for Microsoft tools?

Considering to develop a desktop application with Qt for Windows. It will be a free download application, but for a commecial SERVICE. (need an account with our commercial service to work).
I think we could use the Qt for Windows from Nokia (LGLP version) because its free app. But the lastest one version of Qt needs a C++ complier from Microsoft.
Which one?
Do I need to pay for an C++ compiler from Microsoft, or do they have a free version to use with Qt?
Reading info docs, googling and we still cann't understand what tools do I need.
If you want to use the Visual Studio compilers, you can download the free Windows SDK. The following link takes you to the SDK for Visual Studio 2008:
Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1
This includes all the C++ compilers and tools you need. (There is a more recent version available, but Visual Studio 2010 is not yet a "level 1 supported" platform for Qt.) We are using this on standalone build machines and it works fine.
Just a personal opinion, but we have found that using anything other than MSVC on Windows (for example, MinGW) causes a lot of problems. It is not that the other toolchains are bad, it is just that they are all treated as second-class citizens. We had lots of problems with third-party libraries not being able to build in MinGW or having nonexistent build instructions and having to do a lot of manual Makefile editing, etc. You are much more likely to have things "just work" if using MSVC.
For the most part (static linking), you cannot mix and match. You need to pick one toolchain and stick with it. If I were starting from scratch, I'd definitely go with MSVC.
Just our experience (we started with MinGW); your mileage may vary.
No, you do not need to pay for anything.
The Microsoft toolchain is available for free as part of the Microsoft Windows Software Development Kit.
Additionally, the following article may also be of interest to you:
Developing Windows Applications in C++: The tools you need
The alternative supported by Qt is MinGW. The runtime libraries are free from copyright, so you can do whatever you want with them.
It is basically the Windows counterpart of the GNU Compiler Collection (GCC) under Unix.

Will VS2008 compile binaries compatible with Windows 7

I'm using Microsoft Visual Studio 2008 (VC9) to compile a project that has a .dsw file. I already have the 2010 and would prefer to use it, but it seems this dsw was built for 2008.
I'd like to compile and produce a binary that's also compatible with Windows 7. My questions:
if I compile with 2008, will the resulting binary be compatible with Windows 7? I'm not sure at which version of VS did Windows 7 support start.
or does this have nothing to do with the VS version, and is instead related to the Windows SDK? If that's the case, can I use VS2008 with a newer Windows SDK?
Can someone please clarify.
Microsoft has a great backwards compatibility "story", so pretty much anything you compile with any version of Visual Studio/Visual C++ will be compatible with Windows 7. The same may not neccessarily apply in reverse, i.e. if you use an API that's introduced in Windows 7, your application will error when you try to run it on prior versions of Windows.
There are a couple of things to consider though:
If the project was originally written to target Windows XP or earlier, it may fall foul of UAC
There are changes to directory structures (such as %systemdrive%\Documents and Settings becoming %systemdrive%\Users) that are fairly well handled by the link that Windows 7 creates in the root of `%systemdrive%, but you may fall foul of these.
VS2010 includes version 7.0 of the Windows SDK and VS2008 does not. You need Windows SDK v7.0 if you want your app to take advantage of Windows 7 features like jump lists.
Since you already have VS2010 installed, you can just change your include file / lib file paths in VS2008 to point to the Windows SDK v7.0 instead of the default one provided with VS2008. This is assuming you need that version of the SDK.
You do not need the latest Windows SDK if you do not plan to use the latest Windows 7 features like ribbons and jump lists. If you are building your app for the lowest-common-denominator OS (i.e. Windows XP), then really you should be fine using VS 2008 with default settings.
The other concern is, if your code was originally written before Windows Vista came out, it is likely that it will not work properly on Windows 7 unless it is run in Administrator mode, which is something you want to avoid. The only way to fix that is to rewrite much of your code to avoid writing to certain protected directories and avoid using certain APIs that require Administrator privileges.
Windows SDK is well backward compatible. See binary compatibility report between Windows 6.0 and Windows 7.0 on x86_64 generated by the abi-compliance-checker tool for the detailed comparison.
Reports for other Windows versions are here: https://abi-laboratory.pro/index.php?view=windows

Is it possible to run applications compiled by Visual Studio 2008 on Linux?

Is it possible to run applications compiled by Visual Studio 2008 on Linux? Is there plugin that can convert my project exe to a Linux runnable file?
As far as I know, there is no software that allows Visual Studio to generate non-Windows executables.
If it's a native executable (not .NET) you can try running it under WINE and see if that works. If it doesn't I'd guess the options are either to make it work with WINE or see if you can build it as a native Linux application. The latter will be rather painful if it's a GUI application, obviously, and I'd question if it is worth it. Porting a command line app might be doable but don't underestimate the work involved.
if you use dot net there is a MONO library that enables running some dot net application on linux.
but it not fully compatible.
Otherwise you can do it, (maybe using silverlite you would...)
Mono Project

where does msscript.ocx gets installed from

I'm using msscript.ocx in my application which is an activex scripting host for windows.
Although I want to be able to use the same for XP embedded(XPe) which's highly customizable.
1.I want to know whether on XPe, msscript.ocx can be optionally installed or not?
2.Where does it get installed from, IE?
3.Or is it a windows core component which gets installed during the XPe setup?(I know one can unregister it, but can it be an optional installation)
Answering any or all of these questions will be of great help to me.
Thanks in advance.
Sam.
Microsoft's documentation of the MSScript.ocx library is somewhat contradictory on this issue. The short answer is, starting with Windows 2000, the MSScript.ocx library became part of the Windows OS. Subsequent service packs for Windows 2000, XP, and 2003 included bug fixes (1,2,3) for this library. Since that time, the library has remained part of the 32bit portion of Windows and is still included with Windows 7/2008 R2. Even 64bit versions of Windows still include msscript.ocx with WOW64 in C:\Windows\SysWOW64.
For a little history of this library's distribution keep reading.
Msscript.ocx was originally included on the Visual Studio 6 CD as a "optional" library - optional meaning it had to be manually installed. While the library was part of Visual Studio, it was migrated to being part of the Windows OS starting with Windows 2000.
This is where the confusion comes into play. Since msscript.ocx is considered to be a component of both VS6 and Windows 2000, updates were distributed in service packs for both. Even after the last service pack for VS6 was released, additional bug fixes needed to be distributed for older OS's, so a separate download was created specifically targeting Windows 95, 98 and NT4.
This download is targeted for older OS's for the simple fact that it had become a part of the OS in "modern" versions of Windows. If you are using Windows 2000 or greater, the download is unnecessary and - in my experience - can cause compatibility problems.
I think it is not shipped with Windows XP(not a 100% sure)...
But the best choice is to ship it with your installer(even if it was shipped, it can be removed). About the installing - you can put it where you want (in the program folder in Program Files is ok), the important thing is to register it.
The best choice for making installers - Wix
EDIT: reference
The Script control ships with Visual
Basic 6.0; however, Visual Basic 6.0
setup does not install the Script
Control for you. The control is
located in the CD directory
Common\Tools\VB\Script. To install the
script control, try the following
steps:
I think this answers your question....
For those having issues getting MSSCRIPT.OCX to work do the following:
Go to References in Project settings:
Microsoft Script Control 1.0
Microsoft Scripting Runtime
Microsoft Scriptlet Library
Check all those on.
you'llneed to change your development environment to produce a 32 bit version of your appliation, which for most apps won't matter.
For this goto Project,
then select Properties,
select Compile,
Target CPU: x86
In your code, and i'm using visual studio 2019,
' by using the references above the ScriptControl
' should become available for inclusion into your source c
Dim ms As ScriptControl = New ScriptControl
ms.Language = "JavaScript"
ms.Reset()
Try
ms.ExecuteStatement(RichTextBox1.Text)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Does Visual Studio 2008 support Windows 98?

We're looking at upgrading from Visual Studio 2005 to Visual Studio 2008. I discovered the following disturbing comment.
From Update WINVER and _WIN32_WINNT:
Beginning with Visual C++ 2008, Visual C++ does not support targeting Windows 95, Windows 98, Windows ME, or Windows NT.
Does this mean that if we rebuild our products with Microsoft Visual C++ 2008, they will stop working on Windows 98 machines? It sounds like it, but I have trouble believing they'd make that big a change.
It's not just about .NET 3.5. It's about the Windows SDK header file macros and definitions pulled in by the mandatory version bump in WINVER. So yes, Colen, Visual C++ 2008 binaries will target the Windows NT APIs only and while occasionally they may work on Windows 98, you should assume that you cannot use Visual Studio 2008 to target Win9x. You will have to use Visual Studio 2005 or older.
Yes, it does mean that: The Windows CreateProcess and LoadLibrary APIs on Windows NT before Windows 2000 and all of Windows (95, 98, and ME) will not load a DLL or EXE file made by Visual Studio 2008 (VS 9), because the PE header in the file has the required OS version field set to 5.
The error message upon attempting to load a Visual Studio 2008-generated EXE file will (be a very unfriendly modal error dialog) actually say "You need to upgrade your operating system to run this program".
I experimented with editing the field to 4. The binary will be loaded, but any use of the Visual Studio 2008 C-runtime will hang or crash the process. There are ways to get Visual Studio 2008 projects to not use their native C-runtimes, but if massive use of C++ features is important to you, this approach is not going to scale past a small application.
Visual Studio 2005 (VS 8) has most of the features of Visual Studio 2008, but it still targets early OS versions which is why at my shop we are sticking with that for the moment.
It's natural that they do not support older versions of their operating system on their newer products. It would cost them more (not just monetary cost, but also making harder or impossible to provide some newer useful features) to make things work with the limitations (and often bugs) of older systems. This happens all the time, and with everyone; new versions of GCC drop support for older less popular architectures; new releases of glibc require a more recent minimum kernel version; and so on.
These operating systems have long been retired; from Microsoft's point of view, nobody should be using them anymore. If you still want to develop for them, you can use older tools of the same vintage.
The 3.5 Framework won't even install on Windows 2000 Server at this point. So I don't believe that they will on 95, 98, or NT either. Microsoft doesn't want the responsibility of supporting these retired operating systems anymore.
It is my understanding that with the most recent KernelEx all MSVC versions targeting XP could potentially work (results depending on how many "newest" functions/features you will then decide to use)
With respect to what the answer could have been in 2008 instead, there were quite a number of patched libraries even back then (check links on the Wayback Machine if they are broken).
While I agree with JesperE, Windows 98 is such a small percentage of users that it makes little sense to target them, unless of course you know a large percentage of your customers are in fact using Windows 98.
In any case, you can in fact target Windows 98 in Visual Studio 2008 (you can't develop on Windows 98). You must, however, target your projects at .NET 2.0 only, you cannot use any 3.0, or 3.5 features.
I'd recommend that you take this as an opportunity to stop supporting Windows 9x. This is a good reason as any to do so. And, at least if you're writing C/C++ code for the Win32 API, life is much easier if you can assume that the target OS is Windows 2000 or later.
According to .NET 3.5 information, Windows 98 is not supported by .NET 3.5, so I would imagine that is what they mean. You can still do .NET 2.0 and lower development, but if you use the 3.5 libraries, Windows 98 is not supported.

Resources