visual-c++-2010

Seeking workaround for filename conflict with Visual C++ header file

Our code includes vector, which includes memory, which includes Microsoft's intrin.h, but we have an intrin.h of our own on our include path. Hence memory picks up our intrin.h instead of the system one, and fails to compile. Both our intrin.h and Microsoft's have been around for years, but we've never had a conflict before - VS 2010 i...

Should I add the vcxproj.filter files to source control

While evaluating Visual Studio 2010 Beta 2, I see that in the converted directory my vcproj files have become vcxproj files. There are also vcxproj.filter files alongside each project which appear to contain a description of the folder structure (\Source Files, \Header Files, etc.). Do you think these filter files should be kept per-use...

Determine size of functions/stub/namespace in memory

I have a couple of functions in a namespace called stub. I have to determine the exact start address of the namespace and the end address, of at least the size of the namespace in memory (to copy these functions into another process). While this worked perfectly in Visual C++ 2008 by adding a void stub_end() { } at the end of the names...

Unable to instantiate function templates which uses decltype to deduce return type, if called from inside a lambda?

I'm trying to use C++0x, and in particular lambda expression and decltype to simplify some of my code, using the MSVC10 RC compiler. I've run into the following very odd problem: template <typename F> auto foo(F f) -> decltype(f()){ return f(); } template <typename F> void bar(F f){ f(); } int main() { bar([](){ foo([]() { ...

How does switch compile and how optimized and fast is it?

As I found out that I can use only numerical values in C++'s switch statements, I thought that there then must be some deeper difference between it and a bunch of if-else's. Therefore I asked myself: (How) does switch differ from if-elseif-elseif in terms of runtime speed, compile time optimization and general compilation? I'm mainly ...

Visual Studio Express 2010 license

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...

Visual C++ 2010 Express: extension SDK available?

Allegedly, Visual C++ 2010 Express, unlike previous versions, supports third party extensions. I just downloaded the release candidate SDK for Visual Studio 2010, but the installer fails saying that I don't have Visual Studio installed (which is true since i use Visual C++ 2010 Express). Have I missed something? Is there a version of th...

How do i get the screen to pause?

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? #incl...

std::make_shared as a default argument does not compile

In Visual C++ (2008 and 2010), the following code does not compile with the following error: #include <memory> void Foo( std::shared_ptr< int > test = ::std::make_shared< int >( 5 ) ) { } class P { void Foo( std::shared_ptr< int > test = ::std::make_shared< int >( 5 ) ) { } }; error C2039: 'make_shared' : is not a...

initializer_list not working in VC10

hi 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...

Closure and nested lambdas in C++0x

Using C++0x, how do I capture a variable when I have a lambda within a lambda? For example: std::vector<int> c1; int v = 10; <--- I want to capture this variable std::for_each( c1.begin(), c1.end(), [v](int num) <--- This is fine... { std::vector<int> c2; std::for_each( c2.begin(), ...

Is there any way to use VC++ 2010 without including stdafx.h?

Hi all, I've successfully installed M$ VC2010 and start writing simple programs using it. I am very annoyed from the #include<stdafx.h>, So is there any way to compile and run programs without it??? ...

Determine when using the VC90 compiler in VS2010 instead of VS2008?

Is there a (Microsoft-specific) CPP macro to determine when I'm using the VC9 compiler in Visual Studio 2010 as opposed to Visual Studio 2008? _MSC_VER returns the compiler version, so with VS2010 multi-targeting feature, I'll get the same result as with VS2008. The reason for wanting to know the difference is that I created a new VS20...

How do I show and hide forms in Visual C++?

Hey guys, I'm brand new to Visual C++, but not C++. I'm having issues trying to figure out how to show/hide forms. Let's say I have a form Form1 and another form TestForm. In a button click function in Form1.h I have the code: Form1::Hide(); TestForm^ form = gcnew TestForm(); form->Show(); And it works fine. I click the button, and F...

Warning C4564 when building C++/CLI project that consumes strong-typed dataset

After upgrade to VC++ 2010, Warning C4564 is raised (method defines unsupported default parameter) when building a C++/CLI project that consumes a strong-typed dataset from a C# project. ReadersManager.cpp(311): warning C4564: method 'SetNewRecord' of class 'System::Data::DataTable' defines unsupported default parameter 'action' 3> ...

How to use set_intersection with std::set in VC++ ?

I'm trying to compile VC6 project with VC10... I obtain an error C2678 with set_intersection: I wrote some example to understand. Can anybody explain how to compile this snippets ? #include <vector> #include <algorithm> #include <iostream> #include <set> #include <string> int main( ) { using namespace std; typedef set<string> ...

What's missing from Visual C++ 2010 Express?

Possible Duplicate: What is missing in the Visual Studio Express Editions? Specifically for 2010, specifically for C++... what's missing Vs Professional/Premium (annoying the standard version is now named Professional)? ...

lambda expression (MSVC++ vs g++)

I have the following code #include <algorithm> #include <iostream> #include <vector> #include <functional> int main() { typedef std::vector<int> Vector; int sum=0; Vector v; for(int i=1;i<=10;++i) v.push_back(i); std::tr1::function<double()> l=[&]()->double{ std::for_each(v.begin(),v.end(),[&](int n){sum += n; /...

C++0x Lambda overhead

Is there any overhead associated with using lambda expressions in C++0x (under VS2010)? I know that using function objects incurs overhead, but I'm referring to expressions that are passed to STL algorithms, for example. Does the compiler optimize the expression, eliminating what seems to appear like a function call? I started to really...

Visual Studio 2010 IDE with Visual C++ 6.0 compiler ?

How can I do that ? Can I work in VS2010 IDE but have it compile with the VS C++ 6.0 compiler? And can I work in VS2010 IDE and have it compile by using the the VS2008 compiler ? ...