visual-c++

std::filesystem and std::experimental::filesystem problem in different compilers

大兔子大兔子 提交于 2020-12-15 06:47:09
问题 I am writing a library (just for learning) which utilizes std::filesystem. It works fine on MSVC however by default LTS releases of Linux like Ubuntu ships with GCC 6.x and clang in the official repository is 3.8 which doesn't have std::filesystem instead I have to use std::experimental::filesystem. How may I workaround this problem so that I can support GCC 6, GCC 8+ (where std::filesystem works), Clang 3.8, latest Clang and MSVC? I am using CMAKE as my build system 回答1: Conditional

C++ fatal error C1001: An internal error has occurred in the compiler with openMP

痴心易碎 提交于 2020-12-15 06:13:09
问题 I have a program that solves sudoku puzzles and I've gotten it to work sequentially, but now I'm trying to parallelize it using openMP. The function solvePuzzle() includes the algorithm and I want to parallelize the for loop within it however when I add #pragma omp parallel for statement before my for loop i get this error: fatal error C1001: An internal error has occurred in the compiler. The code for the function is solvePuzzle() : bool sudoku::solvePuzzle(int grid[CELL][CELL]) { int row,

How do i use samplegrabber in vc++ ? The samplegrabber is not defined

扶醉桌前 提交于 2020-12-12 17:44:36
问题 In visual community 2015 I have a c++ project. In the cpp file top I have #include "stdafx.h" #include "VideoCaptureFilterSample.h" #include "VideoCaptureFilterSampleDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif I also set when entering the project properties > VC++ Directories I added this directory in include: C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses The problem is when I type in my code this: hr = CoCreateInstance(CLSID

How do i use samplegrabber in vc++ ? The samplegrabber is not defined

我只是一个虾纸丫 提交于 2020-12-12 17:44:20
问题 In visual community 2015 I have a c++ project. In the cpp file top I have #include "stdafx.h" #include "VideoCaptureFilterSample.h" #include "VideoCaptureFilterSampleDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif I also set when entering the project properties > VC++ Directories I added this directory in include: C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses The problem is when I type in my code this: hr = CoCreateInstance(CLSID

How do i use samplegrabber in vc++ ? The samplegrabber is not defined

别说谁变了你拦得住时间么 提交于 2020-12-12 17:43:45
问题 In visual community 2015 I have a c++ project. In the cpp file top I have #include "stdafx.h" #include "VideoCaptureFilterSample.h" #include "VideoCaptureFilterSampleDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif I also set when entering the project properties > VC++ Directories I added this directory in include: C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses The problem is when I type in my code this: hr = CoCreateInstance(CLSID

How do i use samplegrabber in vc++ ? The samplegrabber is not defined

五迷三道 提交于 2020-12-12 17:43:09
问题 In visual community 2015 I have a c++ project. In the cpp file top I have #include "stdafx.h" #include "VideoCaptureFilterSample.h" #include "VideoCaptureFilterSampleDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif I also set when entering the project properties > VC++ Directories I added this directory in include: C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses The problem is when I type in my code this: hr = CoCreateInstance(CLSID

How is const std::wstring encoded and how to change to UTF-16

不羁的心 提交于 2020-12-12 09:41:58
问题 I created this minimum working C++ example snippet to compare bytes (by their hex representation) in a std::string and a std::wstring when defining a string with german non-ASCII characters in either type. #include <iostream> #include <iomanip> #include <string> int main(int, char**) { std::wstring wstr = L"äöüß"; std::string str = "äöüß"; for ( unsigned char c : str ) { std::cout << std::setw(2) << std::setfill('0') << std::hex << static_cast<unsigned short>(c) << ' '; } std::cout << std:

How is const std::wstring encoded and how to change to UTF-16

泄露秘密 提交于 2020-12-12 09:38:07
问题 I created this minimum working C++ example snippet to compare bytes (by their hex representation) in a std::string and a std::wstring when defining a string with german non-ASCII characters in either type. #include <iostream> #include <iomanip> #include <string> int main(int, char**) { std::wstring wstr = L"äöüß"; std::string str = "äöüß"; for ( unsigned char c : str ) { std::cout << std::setw(2) << std::setfill('0') << std::hex << static_cast<unsigned short>(c) << ' '; } std::cout << std:

MFC MessageBox Not Showing at Top Of All Windows

别说谁变了你拦得住时间么 提交于 2020-12-11 02:51:09
问题 i have created an Application in VC++, the Problem is that if an Error Occurs i display the MessageBox. but that MessageBox doesn't show at front. i have to press ALT key to become in-front of that application. My Application becomes in-active until i press ALT. and Press OK on the MessageBox. Here is the Code Attached. MessageBox(NULL,"Invalid File, Parsing is going to be terminate"); AfxMessageBox("Win32 MessageMessage",MB_OK | MB_ICONEXCLAMATION | MB_TOPMOST); i wil very grateful if

How is it possible to find all occurrences of a method if the Visual Studio „Find All References“ does not work?

China☆狼群 提交于 2020-12-07 19:00:49
问题 The special case I am dealing with is to find all usages of the method CTime::Format in the entire solution. Please assume that the Visual Studio functionality „Find All References“ does - as suspected - not work. 回答1: In order to find all usages of the method CTime::Format follow the steps: Step 1: Replace the string CTime by the string CCTime in the entire solution. Step 2: Implement the following: #include "atltime.h" class CCTime : public CTime { public: [[deprecated("--> uses the method