Create C++ DLL with Visual Studio 2019 for Windows 98 - c++11

I have the source code of an old C++ DLL that I want to add a new function to. The DLL was written years ago for the "Windows 98" operating system.
So I have the following question:
Is it possible to recompile the DLL with Visual Studio 2019 and Windows 10 from the existing source code?
Which settings do I have to make?
What do I have to be aware of?
Which compiler or tool do I need and how do I set it up?

Related

Visual studio 2019 forces x64 and changes project/solution files unasekd

I have a cmake project (cmake 3.19.0-rc1) that I want to build using Visual Studio 2019 (Microsoft Visual Studio Community 2019 Version 16.7.6). There are no toolchain files in the project.
The solution and project files are created via
cmake -G "Visual Studio 16 2019" -A Win32
The solution is created successfully with the Win32 target platform. The first build works as expected.
However after that, Visual studio informs me that the project and solution file has changed outside of the IDE and that they need to be reloaded. After that the target platform is x64.
I can manually re-add the Win32 target platform, but with every compilation, visual studio resets the target platform to x64.
How can I stop this behavior and just stick with the Win32 platform?
Apparently it was a Visual Studio extension (Clang Power Tools) that decided it needs to edit the stamp files. This caused a recreation after the build process.
The problem was solved by deactivating and deinstalling the Clang Power Tools extension.

How to debug VB 6 binaries in Visual Studio 2015

I used to debug VB 6 binaries using VS 2005 few years back. Now I am trying to do the same in VS 2015 but I am not able to. Could anyone please tell me step by step how can I debug VB 6 binaries in VS 2015?
In your VB6 project's Project->Properties->Compile, check "Compile to Native Code," "No Optimization" and "Create Symbolic Debug Info."
In Visual Studio 2015's Debug->Options, check "Use Native Compatibility Mode":
At runtime, in VS2015, attach to the process containing your VB6 executable. At this point, you should be able to set breakpoints and step through the code.

Use the 64-bit Visual C++ Toolset in Visual Studio 2017

My (quite large) C++ project has grown to a point where I get a C1060: compiler is out of heap space error when trying to compile my project.
I'm compiling on a 64-bit Windows 10 machine, but it seems that Visual Studio is compiling my project with the 32-bit toolset (see screenshot below).
The C1060 help page asks me to use the 64-bit toolset, but the link provided talks about how to enable it when compiling with the command line only.
Is there any way to set project properties or something else in Visual Studio 2017 to tell it to use the 64-bit compiler toolset (which is already installed on my machine)?
This is how I made Visual Studio 2017 use the x64 toolset, as per this answer:
Open the .vcxproj file with your favourite text editor, find this line:
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
Then add this immediately after it:
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
That answer was for Visual Studio 2013 but it works for 2017 too.
Additional Note: However, it turns out this didn't actually solve my problem. The 64-bit toolset ate up all the memory on my machine and forced me to need to reboot. When I rolled back the latest changes to the code, it compiles using ~2.8GB for the 32-bit compiler, and compiles using ~4.2GB for the 64-bit compiler (the latest code consumed ~6.4GB before freezing my task manager on my 8GB machine). I'll be looking through the new code and attempting to figure out why so much more memory was needed.

What is the minimum OS for a windows console app made with Visual C++ 2010?

I've created a console application using Visual C++ 2010. What is the earliest version of windows I can run the program on? I know that it can depend on what Windows API functions that you use in the program, so I only use the following functions in my program:
GetStdHandle()
SetConsoleTextAttribute()
Everything else in the program is standard C++. I know that console applications should be able to run on very early versions of Windows, but I do not know how VC++ 2010's compilation affects the minimum operating system requirement. So, would a console application compiled on Windows Vista with Visual C++ 2010 be able to run on, say, Windows 95, ect.?
According to Can I use Visual Studio 2010's C++ compiler with Visual Studio 2008's C++ Runtime Library?, VS C++ 2010 runtime depends on features from Windows XP SP2. So, unless you do some workarounds to avoid the C++ 2010 runtime, that is the oldest version you can target.

Program win32 on Windows 8 Pro

Can I program on Windows 8 Pro for win32 c++ application only If I install Visual C++ 2010 and not visual c++ 2012? Do I need to make any changes for the project to compile the same way like it will be on Vista?
Yes you can.
no need to change the compilation process.

Resources