visual-c++-2008

Why are my Visual C++ 2008 x64 builds 5x slower than x86 builds?

I've been trying to improve the build times for my product. We're using continuous integration, and our builds are now taking 2 hours to run. I've looked at the NANT timings and see alot of places that are slower than they should be, but one that jumps out is the x64 builds of our Visual C++ projects. Here's an example of the timings ...

Visual C++ 2008 as frontend for Access

I am working on a database project that requires me to code in C++. I have the framework for the relational database built using Microsoft Access. Since I would like a GUI for the user, I am trying to use Visual C++ 2008 to build it. I have tried to build a solution as a win32 console app, MFC app, and CLR app, each halting me with thei...

Conditional compiling according to VC++ compiler version

I am in the process of migrating our VC++ project from Visual Studio 2005 (VC8) to Visual Studio 2008 (VC9). Some of the projects in the solution have paths to third party libraries in their 'Additional Library Directories' field in the project settings. The paths look something like this: ..\SomeLibrary\Lib\vc9\x86 It would be really u...

name mangling with def file and extern "C"

Hi, I'm creating a basic COM component so I can practice creating them. I'm exporting DllRegisterServer, DllUnregisterServer,DllGetClassObject and DllCanUnloadNow from a .def file with the PRIVATE keyword(I think Microsoft requires it). Anway, I specified all 4 functions with extern "C" and yet I'm still getting mangling. Here is my ....

How to hide console window of subprocess?

I'm trying to write a very simple program to replace an existing executable. It should munge its arguments slightly and exec the original program with the new arguments. It's supposed to be invoked automatically and silently by a third-party library. It runs fine, but it pops up a console window to show the output of the invoked progr...

vc9 error 4430 on one machine, not on the other

Compiling the same code on two different machines. We have int functions that are not explicitly defined as such in the CPP file. One machine compiles fine, the other doesn't. What's really weird is that they were both working fine until yesterday. One of the machines lost its visual studio include and link paths and now the compile is ...

Compile time error C4407.

Hi All, We have the following class structure in our code Class A: public CDialog, public Base1, public Base2 { }; In implementation of Class A we have the following: BEGIN_MESSAGE_MAP( A, CDialog ) ON_WM_SIZE() END_MESSAGE_MAP() Please note Base1 and Base2 doesn't inherit from CDialog or any other MFC classes. On VC6 the com...

VS2008: Can I build a project with 2 CPP files of the same name in different folders?

Here is my folder structure: / | -- program.cpp -- utility.h -- utility.cpp | -- module/ | -- utility.h -- utility.cpp // Note that I have two files named utility.h and two named utility.cpp On building the project, I get a link error (LNK2028: unresolved token and so on...) saying that some symbols aren't defined. ...

Visual C++ 2008 - Additional Include Directories dialog is empty

I am having a very weird problem with Visual C++ 2008, on certain projects I cannot properly open the "Additional Include Directories" dialog box anymore. I get the following window instead, which is missing the list itself, and where the "macros" button doesn't work. No matter what the "Additional Include Directories" field contains, ev...

ITERATOR LIST CORRUPTED in std::string constructor

The code below compiled in Debug configuration in VS2005 SP1 shows two messages with “ITERATOR LIST CORRUPTED” notice. Code Snippet #define _SECURE_SCL 0 #define _HAS_ITERATOR_DEBUGGING 0 #include <sstream> #include <string> int main() { std::stringstream stream; stream << "123" << std::endl; std::string str = stream.str(); s...

extern "C" has no effect in msvc++ 9.0

I manage project for JNI for both compilers: MSVC++ 8.0 and 9.0, my cpp file contains following implementation: extern "C" { JNIEXPORT jlong JNICALL Java_context_ServiceProviderContext_StartServiceProvider (JNIEnv * env, jclass, jstring jspath){ ..... } With help of depends.exe utility I can see that MSVC 8.0 successfu...

Recovering graceflly from a failed vsnprintf on msvc2008

I'm looking for a way to use some variant of vsnprintf() with a buffer that can possibly be longer than the input buffer without triggering an error to the user. So far I've found that vsnprintf() and its variants silently truncate the string when the buffer is too small but they don't return the actual length of the string so I can't t...

Intrinsics Vs inline ASM for SSE coding in VC++ 2K8

I've done some inline ASM coding for SSE before and it was not too hard even for someone who doesn't know ASM. But I note MS also provide intrinsics wrapping many such special instructions. Is there a particular performance difference, or any other strong reason why one should be used above the other? To repeat from the title, this is ...

VS 2008 irritating copy constructor link dependency

Hi guys, I've run into the following annoying and seemingly incorrect behaviour in the Visual Studio 2008 C++ compiler: Suppose I have a class library - Car.lib - that uses a "Car" class, with a header called "Car.h": class Car { public: void Drive() { Accelerate(); } void Accelerate(); }; What I'm actual...

How am I getting this error?

Doing Managed C++ in VS2008. Have a vendor defined data structure as follows: class API TF_StringList { public: TF_StringList(const char* encoding = "cp_1252"); ~TF_StringList(); TF_String* first_string() const {return start_string;} TF_String* last_string() const {return end_string;} void insert(const TF_String& aString); voi...

How do I make VC++'s debugger break on exceptions?

I'm trying to debug a problem in a DLL written in C that keeps causing access violations. I'm using Visual C++ 2008, but the code is straight C. I'm used to Delphi, where if an exception occurs while running under the debugger, the program will immediately break to the debugger and it will give you a chance to examine the program state...

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

Visual C++ 2008 doesn't recognize Windows declared types

I have a program that doesn't seem to recognize declared types in the latest U3D software. There's a line typedef BOOL (WINAPI* GMI)(HMON, LPMONITORINFOEX); which gets the error: Error 1 error C2061: syntax error : identifier 'LPMONITORINFOEX' c:\Projects\U3D\Source\RTL\Platform\Common\Win32\IFXOSRender.cpp 28 and a line ...

Cannot add library in VC++ 2008: My System is Different

Hopefully someone can tell me what's going on here. I'm trying to link to gdiplus.lib and I tried to go to "Properties - Linker - Input - Additional Dependencies" to add the library but I do NOT have that section. I'm using Visual C++ 2008. Here's what I see: Common Properties Framework and References Configuration Properties Gen...

How to simulate a file read error in the CRT

Using VS2008, we would like to simulate a file that has a size of X, but that has a read failure at X-Y bytes, so that we get an error indication. Anyone have an idea of how to do this on windows? Looks like there is a solution for linux, but I can't really come up with a way to do this on windows. We have multiple developers, multiple...