visual-c++

How would one transfer files larger than 2,147,483,646 bytes (~2 GiB) with Win32 TransmitFile()?

一个人想着一个人 提交于 2021-02-04 19:08:21
问题 Quoted from MSDN entry for TransmitFile: The maximum number of bytes that can be transmitted using a single call to the TransmitFile function is 2,147,483,646, the maximum value for a 32-bit integer minus 1. The maximum number of bytes to send in a single call includes any data sent before or after the file data pointed to by the lpTransmitBuffers parameter plus the value specified in the nNumberOfBytesToWrite parameter for the length of file data to send. If an application needs to transmit

difference between function hiding and overloading

久未见 提交于 2021-02-04 18:08:52
问题 I can't find any difference between function hiding and overloading. As the function hiding is the function that is present in derived class and hides the function of a base class. Having same name of the function in both of them. Overloading: having same name but different signature in both derived and base class. class A { void print(int); }; class B: public A { void print(float); }; does it hide function or overload ? 回答1: The function B::print hides the parent function A::print . If you

difference between function hiding and overloading

偶尔善良 提交于 2021-02-04 18:07:33
问题 I can't find any difference between function hiding and overloading. As the function hiding is the function that is present in derived class and hides the function of a base class. Having same name of the function in both of them. Overloading: having same name but different signature in both derived and base class. class A { void print(int); }; class B: public A { void print(float); }; does it hide function or overload ? 回答1: The function B::print hides the parent function A::print . If you

difference between function hiding and overloading

£可爱£侵袭症+ 提交于 2021-02-04 18:07:21
问题 I can't find any difference between function hiding and overloading. As the function hiding is the function that is present in derived class and hides the function of a base class. Having same name of the function in both of them. Overloading: having same name but different signature in both derived and base class. class A { void print(int); }; class B: public A { void print(float); }; does it hide function or overload ? 回答1: The function B::print hides the parent function A::print . If you

How to take a screenshot of a second screen monitor?

独自空忆成欢 提交于 2021-02-04 16:23:05
问题 I need get a screenshot of a second screen monitor. I found a simple way to make a screen shot, but only works for screen shot of a primary monitor. Here is the code: #include <windows.h> void ScreenShot(char*BmpName){ HWND DesktopHwnd = GetDesktopWindow(); RECT DesktopParams; HDC DevC = GetDC(DesktopHwnd); GetWindowRect(DesktopHwnd, &DesktopParams); DWORD Width = DesktopParams.right - DesktopParams.left; DWORD Height = DesktopParams.bottom - DesktopParams.top; DWORD FileSize = sizeof

“signed/unsigned mismatch” warnings (C4018) with decrementing for loop

喜夏-厌秋 提交于 2021-02-04 16:22:08
问题 What should I do about the "signed/unsigned mismatch" warning in C++ code like this: for (int i = vector.size() - 1; i >= 0; --i) // OK { if (i < vector.size() / 2) // warning C4018: '<': signed/unsigned mismatch // ... } (A contrived example, but it demonstrates the problem.) How do I deal with "signed/unsigned mismatch" warnings (C4018)? says to use size_t for the loop variable, but this doesn't work for a decrementing loop terminating at 0. It compiles without warning, but the integer

Using fopen_s in C

亡梦爱人 提交于 2021-02-04 11:33:53
问题 I have a problem with programming in C, especially with fopen in Visual Studio. I read about the fopen_s function and added the following line to my project, but it still doesn't work. _CRT_SECURE_NO_WARNINGS So I tried using fopen_s in this way: FILE *fp; errno_t err; if ((err = fopen_s(&fp, "C:/File.txt", "rt")) != 0) printf("File was not opened\n"); else fprintf(fp, "Date: %s, Time: %s, Score: %i \n", __DATE__, __TIME__, score); fclose(fp); It's still crashing. What's wrong? 回答1: You use

Using fopen_s in C

孤街醉人 提交于 2021-02-04 11:33:47
问题 I have a problem with programming in C, especially with fopen in Visual Studio. I read about the fopen_s function and added the following line to my project, but it still doesn't work. _CRT_SECURE_NO_WARNINGS So I tried using fopen_s in this way: FILE *fp; errno_t err; if ((err = fopen_s(&fp, "C:/File.txt", "rt")) != 0) printf("File was not opened\n"); else fprintf(fp, "Date: %s, Time: %s, Score: %i \n", __DATE__, __TIME__, score); fclose(fp); It's still crashing. What's wrong? 回答1: You use

How to change default C++ language standard in Visual Studio 2019?

…衆ロ難τιáo~ 提交于 2021-02-04 08:09:54
问题 I'd like to use C++17 for my projects without always having to change it in the properties when starting a new one. Is this possible? Thanks! 回答1: Edit the property sheet under the View -> Other Windows -> Property Manager Next open the tree for a project and then the platform you wish to change. The settings here are inherited by default for all project configurations of the corresponding platform so right click the node for "Microsoft.Cpp..User" and then go to C/C++ -> Language and set the

Microsoft C++ Build tool required to install fabric - Python

风流意气都作罢 提交于 2021-01-29 19:43:25
问题 I'm trying to install fabric via pip install fabric in order to deploy a flask app on a server. I have the following error : ERROR: Command errored out with exit status 1: command: 'c:\users\alex\appdata\local\programs\python\python38-32\python.exe' 'c:\users\alex\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\pep517\_in_proces s.py' build_wheel 'C:\Users\Alex\AppData\Local\Temp\tmp5bslt539' cwd: C:\Users\Alex\AppData\Local\Temp\pip-install-yyi3arer\bcrypt [...]