64 questions
1 vote
3 answers
2k views
Visual Studio clears command line arguments when begins to run
In my solution, I have a Visual C++ project which uses Platform Toolset = Visual Studio 2013 (v120) which I am opening in Visual Studio 2019. If I edit the Project Properties > Configuration ...
2 votes
3 answers
126 views
How to find maximum dereferenceable-level of the parameter T using template
I am designing a "dereferencer" class, for fun. I wrote some structs and aliass : template <class _T> using deref_type = decltype(*std::declval<_T>()); template <class _T, ...
0 votes
0 answers
56 views
Is there are a command line option for preventing the compiler to convert 64 bit into 32 bit operations in C++?
I get generated c-code that might have 64 bit operations and datatypes. I compile it for a 32 bit CPU so the compiler emulates the 64 bit types/operations using a series of 32 bit types/operations. ...
2 votes
1 answer
268 views
sscanf fails to read double hex
I need to preserve the exact binary representation of some doubles in a text file with other ascii values, so I am using "%a" as suggested in this question. fprintf (pFile, "Scale: %a, %a, %a\n", ...
-1 votes
1 answer
694 views
The SetMarquee function is not working on MultiByte Character Set in C++
I am using Multibyte Character Set on my project. The SetMarquee function is not allowed to access while the character set is MultiByte. The below function available in C:\Program Files (x86)\...
1 vote
2 answers
182 views
Somewhat unexpected behaviour from left shift <<
This is a 32-bit MFC application currently running on Windows 10. Compiled with Visual C++ 2013. std::cout << "sizeof(long long) = " << sizeof(long long) << std::endl; int rot{ 32 ...
2 votes
1 answer
2k views
Ignore the CERTIFICATE_ERROR using CPP REST SDK
I have been using the CPP Rest SDK for my application which serves as both HTTP_Client and HTTP_Server as well. And now I want to support HTTPS in my application. The HTTP_Client will be running in ...
15 votes
4 answers
9k views
How to limit the number of parallel cl.exe processes during the Visual Studio solution build?
I've recently noticed that once I start building the Visual Studio solution I'm working with (~200 C++ projects), I get a very large number of cl.exe processes. I'm not surprised by the fact of ...
2 votes
0 answers
125 views
Instance of unnamed class in unnamed namespace
Using functors with parameters generally looks like that: // Definition: struct some_functor_with_params { int ref; explicit some_functor_with_params(int ref) : ref(ref) {} bool operator (...
1 vote
0 answers
336 views
static constexpr member in-class initialization
Could anyone help me find out what is wrong with in-class initialization of static constexpr member varaible like in the code below ? Using Visual Studio 2013 struct hg { public: static ...
0 votes
2 answers
34 views
Creating a text file with a certain string and using it to compare in the future
I want to create a text file for first run carrying the password and use the code to check the entire string for the password entered previously. The current code returns true value for the 1st few ...
2 votes
0 answers
2k views
error MSB6006: "cmd.exe" exited with code 2
I had been compiling on my Visual Studio making small changes from the morning and it was running fine. I made a small change and I started getting this error, error MSB6006: "cmd.exe" exited with ...
9 votes
2 answers
338 views
Brace-or-equal-initializers in anonymous struct does not work on VS2013
Brace-or-equal-initializers in an anonymous struct within a struct doesn't do their work on output produced by VS2013. There's the code: #include <iostream> #include <cstdint> struct S { ...
0 votes
1 answer
929 views
How to check if installed product is in corrupt state ?
I'm installing Visual C++ Redistributable 2013 as a prerequisite (if its not installed)through my installer. But sometimes already installed VC++ is corrupted then my installer does not work because I'...
1 vote
1 answer
1k views
How to use File::ReadAllBytes in visual c++?
Visual Studio has a simple method "File::ReadAllBytes" that will read a file and return a byte array, but I don't know how to use it. I tried the following and they all don't work. Byte arr[] = File::...