msvcrt

fread Only first 5 bytes of .PNG file

I've made a simple resource packer for packing the resources for my game into one file. Everything was going fine until I began writing the unpacker. I noticed the .txt file - 26 bytes - that I had packed, came out of the resource file fine, without anyway issues, all data preserved. However when reading the .PNG file I had packed in the...

Install VC++ Runtime 64-bit if system is 64-bit

I am creating a Visual Studio 2010 Setup project for installing my application. My application works by having multiple executable for different system bitness, and detects if you are running on a 32-bit or 64-bit system. I'd like to have the Visual C++ 2010 x64 Runtime installed by the installer if it is a 64-bit system. Setting this a...

Building the MSVC runtime from source

Hello, As an exercise in understanding the underlying functionality provided by the MS C Runtime, I've been looking at the source code for it provided with Visual Studio. However, I keep running into errors trying to actually build the code. These are the two main errors that have the problem: Command line error D2016 : '/Ze' and '/Za'...

How do I get the file HANDLE from the fopen FILE structure?

The fopen function returns a pointer to a FILE structure, which should be considered an opaque value, without dealing with its content or meaning. On Windows, the C runtime is a wrapper of the Windows API, and the fopen function relies on the CreateFile function. The CreateFile function return a HANDLE, which is used by other Windows AP...

DBGHelp.dll causes load of msvcrt.dll in debug version

My application compiles with VC6 sp6, uses DBGHelp.lib to get stack information. The code is simmilar in debug and release compilations. The problem is that when executing the debug version, DBGHelp.dll loads msvcrt.dll (the release version). msvcrtd.dll is already loaded by my debug link anyway. So I end up having both msvcrtd.dll and m...