From 7cdd6853aa5d73a55f17e01c53a4e1d64cb755ad Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 2 Jun 2013 19:19:25 +0300 Subject: [PATCH] VirtualDesktops: Replace std::fstream with C file functions --- Plugins/PluginVirtualDesktops/DexpotMeasure.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Plugins/PluginVirtualDesktops/DexpotMeasure.cpp b/Plugins/PluginVirtualDesktops/DexpotMeasure.cpp index bb11ba76..02d12fcf 100644 --- a/Plugins/PluginVirtualDesktops/DexpotMeasure.cpp +++ b/Plugins/PluginVirtualDesktops/DexpotMeasure.cpp @@ -19,7 +19,6 @@ #include "DexpotMeasure.h" #include -#include #include "DexpotConstants.h" #include "../../Library/Export.h" @@ -452,13 +451,13 @@ void DexpotScreenshotMeasure::UpdateScreenshot() bmfh.bfSize = bmfh.bfOffBits + nBytes; bmfh.bfType = 0x4d42; - std::ofstream ofs(OutputFile.c_str(), std::ios_base::binary); - if (ofs) + FILE* file = _wfopen(OutputFile.c_str(), L"wb"); + if (file) { - ofs.write((char*) &bmfh, sizeof(BITMAPFILEHEADER)); - ofs.write((char*) &bmi, sizeof(BITMAPINFOHEADER)); - ofs.write((char*) ScaledBytes, nBytes); - ofs.close(); + fwrite(&bmfh, sizeof(BITMAPFILEHEADER), 1, file); + fwrite(&bmi, sizeof(BITMAPINFOHEADER), 1, file); + fwrite(ScaledBytes, nBytes, 1, file); + fclose(file); } SelectObject(MemDC, OldBitmap);