visual-c++

Why do I get a “member function not present” error when evaluating expressions on the VC++ debugger?

丶灬走出姿态 提交于 2020-01-14 07:47:28
问题 I've got a static method, MyClass::myMethod() on another DLL, MyDll.dll . In my code, I call this method, and it compiles and runs fine. But when I try MyClass::myMethod() in the immediate window (or the watch window), I always get: MyClass::myMethod() CXX0052: Error: member function not present Why is that? Update : I've found out that when I use the context operator it works: {,,MyDLL}MyClass::myMethod() I'm not really sure why it's needed, though, so I'm going to wait a bit to see if

cvblob compile error in Visual C++ 6.0

混江龙づ霸主 提交于 2020-01-14 05:40:35
问题 I'm using Microsoft Visual C++ 6.0 and Microsoft Visual Studio 2008 to develop an academic computer vision project. In this project i need to use OpenCV 1.1 (http://opencv.willowgarage.com/) and CvBlob (http://code.google.com/p/cvblob/). I tried to compile this project with Microsoft Visual Studio 2008 and it compiles without errors. With Visual C++ 6.0 i got a lot of errors. OpenCV are not responsible of this behavior, because a trivial project with only OpenCV (without CvBlob) works well.

How to fix compiler errors in SAPI 5.1 Header Files

僤鯓⒐⒋嵵緔 提交于 2020-01-14 05:14:18
问题 I got a lot of errors from SAPI 5.1 provided header files and cannot figure out how to fix those problems. Following is a simple Text to Speech program from Microsoft’s How to Video Presentation. The presenter said, if you have installed the most updated packages, you will have no problem compile this program. But he is using Video Studio 2005; apparently the “most updated” refers a few years ago when the presentation was given. I think these errors are caused version miss match. I am using

how to remove space between characters of a string using wide char to multibytes?

这一生的挚爱 提交于 2020-01-14 05:13:11
问题 I have a file open in winhex look like follow. 1F 00 48 3A 18 00 00 00 53 00 70 00 6F 00 75 00 73 00 65 00 5F 00 61 00 7A 00 61 00 6D 00 00 00 I am reading the above hex data from file and write it to a text file . My code is as follow. #include<stdlib.h> #include<stdio.h> #include<iostream.h> int main() { FILE *pFile, *tempFile; char *Main_buffer; int nOfRecord, TotalSize, data=0; pFile = fopen("C:\\wab files\\Main.wab", "rb"); if(pFile == NULL) { fputs("file error", stderr); exit(1); }

sort the 'std::vector' containing classes

眉间皱痕 提交于 2020-01-14 04:43:41
问题 Sort by using a binary predicate and std::sort I need the sample for this... 回答1: Here is another adaptation of the example that uses two different kinds of predicates. The predicate specified can be a function pointer or a functor which is a class that defines operator() so that the object when instantiated can be used just like a function would be. Notice that I had to add one more header inclusion to the functional header. This is because the functor inherits from binary_function which is

sort the 'std::vector' containing classes

狂风中的少年 提交于 2020-01-14 04:43:01
问题 Sort by using a binary predicate and std::sort I need the sample for this... 回答1: Here is another adaptation of the example that uses two different kinds of predicates. The predicate specified can be a function pointer or a functor which is a class that defines operator() so that the object when instantiated can be used just like a function would be. Notice that I had to add one more header inclusion to the functional header. This is because the functor inherits from binary_function which is

Windows C++ Pipe Creates Big Black Terminal Window

社会主义新天地 提交于 2020-01-14 04:35:09
问题 I'm trying to pipe io through a terminal application as per microsoft's documentation (http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx). The problem is, when I add this code, it pops up a big black empty box / terminal / console window. I don't want it to do that. Suggestions? Thanks! 回答1: Make sure that the dwFlags member of the STARTUPINFO structure has the STARTF_USESHOWWINDOW bit set and that the wShowWindow is set to SW_HIDE. That should work 回答2: You need to padd CREATE_NO

Error c4996 Checked Iterators

我只是一个虾纸丫 提交于 2020-01-14 01:54:34
问题 I use VC++ 2013 and I have a following code: #pragma warning(disable:4996) #define D_SCL_SECURE_NO_WARNINGS #include <iostream> #include <fstream> #include <object.pb.h> using namespace std; int main(int argc, char** argv) { Object object; object.set_id(1); object.set_name("Ermolaev Ivan"); object.set_vertex(300.0f); fstream output("myfile", ios::out | ios::binary); object.SerializeToOstream(&output); return 0x0; } But following error continue displayed. Error 1 error C4996: 'std::_Copy_impl'

When will _ATL_ALLOW_UNSIGNED_CHAR work?

橙三吉。 提交于 2020-01-14 01:52:18
问题 I'm migrating a Visual C++ project which uses ATL/MFC from VS2010 to VS2013. The project compiles with /J ("assume char is unsigned"), and there is too much code that may or may not rely on that fact to easily remove the compiler flag. Under VS2013, /J causes a compiler error in atldef.h: ATL doesn't support compilation with /J or _CHAR_UNSIGNED flag enabled . This can be suppressed by defining _ATL_ALLOW_UNSIGNED_CHAR . Microsoft mention this in the MSDN documentation for /J, along with the

In place member initialization and aggregate initialization

丶灬走出姿态 提交于 2020-01-13 19:46:45
问题 I have this simple struct and a function taking it: struct S { int a; }; void foo(S){} foo({5}); This works fine. But if I change int a; to int a{0}; VisualStudio (2013 and 2015) complains: error C2664: 'void foo(S)': cannot convert argument 1 from 'initializer list' to 'S' I can't find corresponding rule for this in the documentation. But both gcc and clang accept this without problem. 回答1: struct S { int a; }; is an aggregate whereas struct S { int a {0}; // or int a = 0; }; is not an