dll built with visual studio 2010 / windows 7 => usable on Windows 6? - visual-studio-2010

Question from a Linux/Mac developer: I have compiled a 32-bit .dll (release flavor) under Windows 7 using Visual Studio 2010. Should this .dll be usable under all flavors of Windows 6 (a.k.a. Vista, if I'm not mistaken)?
Many thanks and RTFMs appreciated,
John Clements

In general: yes.
All current versions of the .Net framework run on both Vista and Win7.
Note that if you make calls into the native platform, either directly or via the Windows API Code Pack, you could have portability problems if you use functions available only in Win7. But for just straight .Net development, you should have no issue in running on any supported version of Windows.

Yes, the dll format didn't change for Windows 7. Only thing to remember is that if it's a .Net dll, the target system must have the proper .Net installed or the appropriate C/C++ runtime.

You're supposed to #define the _WIN32_WINNT macro to tell what version of Windows you want to support. The default in the SDK that ships with VS2010 is 0x600 which avoids you ever linking to an API function that is not available in Vista. So, yes, you're probably good to go.

Related

How can I target Windows 98?

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.

Does Windows 8 Desktop support c++/cli?

I found some information regarding Windows 8 Metro and c++/cli. Windows 8 Metro does not support c++/cli.
However I am having trouble finding explicit documentation that states whether Windows 8 Desktop supports c++/cli (the linked question is not explicit enough IMO). Does Windows 8 Desktop support c++/cli?
Please make sure to provide a link to your relevant source.
Windows 8 does not support C++/CLI.
It is the other way around, the support does not come from the Windows team (they did not ship a compiler) but from the Visual Studio team. Each Visual Studio version has a list of supported platforms that your application can target if you use that version of Visual Studio to build your app.
So does Microsoft support writing C++/CLI apps for Windows 8 Desktop? The answer is yes if you use the right version of Visual Studio*. Does the support come from Windows? The answer is no.
*You can continue test and provide support to your customers even without Microsoft's support to you, for example you can write C++/CLI code in Notepad then compile it using the cl.exe from VS2012 Express for Windows 8. There's really nothing to prevent this use case to work, despite Microsoft's statement that VS2012 Express for Windows 8 does not support desktop development (and I don't think there's any reason why Microsoft should provide support on this use case with VS2012 Express for Windows Desktop out there) .
The Windows 8 Desktop supports everything that Windows 7 supported. C++/cli included. There really isn't much that talks about this, but here is a link to VS 2012 support for C++/cli which implies the same thing.

Can VS2010 create native executable file working under Windows 2000?

I plan to develop some native C++ project in VS2010. But it is possible my client will require to support Windows 2000. I know VS2008 creates native executable files compatible with Windows 2000. I would like to migrate to VS2010 but i don't know if it is possible to create native executable file compatible with Windows 2000 in VS2010.
CRT of VS2010 uses kernel32.EncodePointer() function which is missing in Windows 2000.
Read this question.
You can write applications for Windows 2000 SP4 using Visual Studio 2010, so long as you only target Version 2.0 of the .NET framework.
Anything higher than .NET 2.0 is not guaranteed to run on Windows 2000 SP4.
You can see the system requirements for each framework here: http://msdn.microsoft.com/en-us/library/8z6watww.aspx

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

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

Resources