visual-c++-2010

error when convert project from vc 6.0 to vc 2010

你离开我真会死。 提交于 2019-12-25 05:12:06
问题 i have successfully compile and build c/c++ project on visual c++ 6.0 to dll .But when i convert to visual c++ 2010 on windwos 7 64bit os it appear many error .source code is typedef struct { int _entID ; /* Entity ID */ int _recID ; /* Recode No. */ int _Nmbr ; /* 画像番号 0020:0013 */ int _Clmns ; /* マトリクス X 0028:0011 */ int _Rws ; /* マトリクス Y 0028:0010 */ int _ImagCnt ; /* 複数フレーム数 0028:0008 */ char _Type[ 68 ] ; /* 画像タイプ 0008:0008 */ char _cUID[ 68 ] ; /* クラス UID 0004:1510 */ char _sUID[ 68 ] ;

Lambda Function does not compile in Visual Studio 2010

。_饼干妹妹 提交于 2019-12-24 19:01:48
问题 I am more interested in knowing WHY it does not compile than fixing the code. fatal error C1001: An internal error has occurred in the compiler. int main() { class MyClass { public: MyClass(const std::string & name) : name_(name) {} std::string name_; }; auto creator = []() -> MyClass * { return new MyClass("Hello World"); }; MyClass * pMyClass = creator(); return 0; } 回答1: fatal error C1001: An internal error has occurred in the compiler. Anytime you see an internal compiler error, you're

Override #pragma once with standard #ifndef MS-VC++

ε祈祈猫儿з 提交于 2019-12-24 03:14:18
问题 I haven't seen any answers to this question (which probably means that it's not allowed) but I thought I'd ask anyway. Is there any way to override the automatic generation of #pragma once in .h or .hpp files created using MS Visual-C++ to use the standard header guards of using portable friendly preprocessor directives? #ifndef _V_DESCRIPTOR_ #define _V_DESCRIPTOR_ // some code here #endif 回答1: To answer your real question, I don't think Visual Studio has any option for that, but it would be

CreateWindowEx returns NULL

拟墨画扇 提交于 2019-12-24 00:59:31
问题 The following is a portion of my code. Every time I run the program, CreateWindowEx of the SPanel returns NULL , triggering an error. Can anyone see what is wrong with this piece of code? SPanelProc and MainWndProc are declared already, and is of the prototype LRESULT CALLBACK SPanelProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); . The environment I'm programming in is Visual C++ 2010. Why is CreateWindowEx always returning NULL ? #include <Windows.h> #include <WindowsX.h> LRESULT

Visual Studio Express 2010 license

本小妞迷上赌 提交于 2019-12-24 00:46:37
问题 Can I use Visual C++ 2010 Express compiler for commercial use? As far as I know, it was always permitted prior to 2010 version, but now when I start IDE, it writes "For Evaluation Purposes Only". I can't find the full license file anywhere (not in installed files, not in Google), so I'm in doubt, should I use it, or should I downgrade to MSVC++2008 version. 回答1: I think you just need to register it. In the help menu click on register product. It will bring you on a web page where you can log

How do I exclude library headers from my Visual Studio static code analysis?

守給你的承諾、 提交于 2019-12-22 04:25:12
问题 I have setup buildbot to compile my Qt/C++ application with the /analyze flag. However the analysis is also delving into the qt headers which I don't care about: c:\qt\qt-everywhere-opensource-src-4.8.1\src\corelib\tools\qvector.h(547) : warning C6011: Dereferencing NULL pointer 'x.p': Lines: 474, 475, 476, 477, 478, 480, 491, 493, 497, 498, 499, 500, 503, 504, 518, 519, 520, 521, 522, 525, 545, 547 Whats the best way to exclude these files en mass? (Please note I am not using the IDE, I am

Warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)

半腔热情 提交于 2019-12-22 01:33:44
问题 I have this problem in my code: bool CBase::isNumber() { return (id & MID_NUMBER); } bool CBase::isVar() { return (id & MID_VARIABLE); } bool CBase::isSymbol() { return (id & MID_SYMBOL); } 回答1: FYI: Casts won't hide the warning by design. Something like return (id & MID_NUMBER) != 0; should clearly state "I want to check whether this value is zero or not" and let the compiler be happy 回答2: Use the !! idiom eg bool CBase::isNumber() { return !!(id & MID_NUMBER); } 回答3: Where's the declaration

initializer_list not working in VC10

♀尐吖头ヾ 提交于 2019-12-21 07:04:11
问题 i wrote this program in VC++ 2010: class class1 { public: class1 (initializer_list<int> a){}; int foo; float Bar; }; void main() { class1 c = {2,3}; getchar(); } but i get this errors when i compile project: Error 1 error C2552: 'c' : non-aggregates cannot be initialized with initializer list c:\users\pswin\documents\visual studio 2010\projects\test_c++0x\test_c++0x\main.cpp 27 and 2 IntelliSense: initialization with '{...}' is not allowed for object of type "class1" c:\users\pswin\documents

Very large array on the heap (Visual C++)

隐身守侯 提交于 2019-12-20 03:06:07
问题 I hope some one can help me, i'm trying to create an int[400000000] (400 millions) array on my application using visual c++ 2010 but it generates an overflow error The same code runs on linux with g++. I need this because i'm working with large matrices. Thank you in advance. 回答1: If you are using a 32-bit application then by default you have just 2GB of user address space. 400 million integers is about 1.5GB. You are very likely not to have this much contiguous address space. It is possible

How do i get the screen to pause? [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-19 05:10:14
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: How to stop C++ console application from exiting immediately? So im learning c++ and i was given this example and i wanted to run it. But i cannot get it to stay up, unless i change it. How do i get Microsoft visual 2010 to keep up the screen when it gets to the end of the program after I release it? #include<iostream> using namespace std; int area(int length, int width); /* function declaration */ /* MAIN