visual-c++-2005

How to setup Google C++ Testing Framework (gtest) on Visual Studio 2005

It is not documented on the web site and people seems having problem setting up the framework. Can someone please show step by step introduction to a sample project setup. ...

can you create a lib or dll in VS 2005 and link with VS 2008

Hello, I am using visual studio 2008 SP1. And I am creating a desktop application using MFC. I have a library I want to link with my application. However, the library was written in WIN32 visual studio 2005. I am been having a trouble linking: fatal error LNK1104: cannot open file 'AgentLib.lib' I am wondering if it is because I ...

Checking if Registry Value exists Visual C++ 2005

Hi There, Im trying to code a Visual C++ 2005 routine that checks the registry for certain keys/values. I have no trouble in writing code using c# but I need it in C++. Anybody know how to do this using c++ in vs2005. Many thanks Tony ...

String Compare not working in Visual C++ 2005

Hi There, If get a gring from the registry and it correctly displays when I place it in a message box. ::MessageBoxW(0, (LPCWSTR)achValue, _T("Found"), MB_YESNO); The value is stored in archValue which is a DWORD. What I want to do is compare it to the following string "2.0.7045.0" but strcmp fails to work for me. Any ideas on how to d...

C/C++ codehighlighter in visual studio 2005

Hi there I just starting using VS2005 and I wish to have code highlighting in C/C++. The VS menu Tools->Options->TextEditor->C/C++ is very poor. I come from PHP and there the IDE's are very friendly when is about highlighting. I didn't expect that Visual Studio to be so poor at this kind of options. Can you recommend me a free tool/plu...

How can I inhibit warning 4200 in Visual Studio 2005?

I can inhibit many warnings in Visual Studio 2005 SP1 in the C/C++ Advanced property page, which causes the IDE to use the /wd switch on the command line which invokes the compiler. However, when I try to inhibit warning 4200 (nonstandard extension used : zero-sized array in struct/union), it still appears when I compile. (Of course it's...

Linear Search in a Char Array -- C++ (Visual Studio 2005)

I am very new to C++ programming and you will see why. I want to make a character array consisting of a few words that I want to search with a linear search function. Does this array have to be a two-dimensional array? For example: char Colors[3][6] = {"red", "green", "blue"}; I tried it like this: char Colors[] = {"red", "green", "...

Visual Studio 2005 C++ Compiler slower that Visual Studio 6 Compiler?

One of our old C++ projects is still with Visual Studio 6. Once a year I try to convert it in to a higher Visual Studio Version but it's not easy because not all the code is written by us. Anyway, I finally succeeded in converting the project to VS2005 after fixing a few hundred lines of code. But compiling the projects takes a very lon...

Create Microsoft Word document from C++ in Visual Studio 2005

Hi. We got a homework assignment to create a Microsoft Word document using Visual Studio 2005 and C++. Could anyone explain how this could be done. I was trying to do it using VSTO, but I've had no luck. All resources on the internet I could find explain how this could be done in VB or C#, but I need some C++ examples. Thanks EDIT: Acc...

creating a DLL in Visual Studio 2005

Hi, I am developing a C++ library that I want to pass on to my team. The library has just one class with a bunch of methods. So, I have developed the class definition file (X.cpp) and a corresponding class declaration file (X.h). Here are my questions -- In Visual Studio 2005, whats is the most straight forward way to build this l...

Visual Studio 2005 Linker problem

I'm mostly new to Visual Studio, so I apologize if this is a basic problem. I have a solution which contains a number of projects. In project A, I have a pre-existing set of files that I added a new class to. Project B uses the functionality coded in that new class in Project A. Project A is built first, and a .lib file is generated,...

C++ error detection in Visual Studio 2005

Coming from a different development environment (Java, mostly) I'm trying to make analogies to habits I'm used to. I'm working with a C++ project in Visual Studio 2005, the project takes ~10 minutes to compile after changes. It seems odd that if I make a small syntactical error, I need to wait a few good minutes to get a feedback on tha...

Does the latest Visual Studio 2005 Security Update cause C runtime library issues when hot fixing customer sites

As you might be aware an update to visual studio 2005 was auto updated on most machines last week. This update included a new version of the visual c runtime library. As a result any binaries built after the update also require a new redistributable installed on client systems. See http://support.microsoft.com/kb/971090/ And here is ...

Building log4cxx on visual 2005

Hello, When I build the log4cxx on Visual 2005 according to instructions http://logging.apache.org/log4cxx/building/vstudio.html, I am getting error below; 1>------ Build started: Project: apr, Configuration: Debug Win32 ------ 1>Compiling... 1>userinfo.c 1>c:\program files\microsoft visual studio 8\vc\platformsdk\include\rpcndr.h(145)...

MATLAB functions in C++

Does anyone know a resource where we can obtain FREE C++ libraries for MATLAB functions? For example, linear algebra problems can be solved using LAPACK and BLAS. Also, MATLAB in a .NET project is out of the question - I'm talking about direct C++ implementations of popular MATLAB functions (I don't know which functions I need in C++ ye...

Function which returns an unknown type

class Test { public: SOMETHING DoIt(int a) { float FLOAT = 1.2; int INT = 2; char CHAR = 'a'; switch(a) { case 1: return INT; case 2: return FLOAT; case 3: return CHAR; } } }; int main(int argc, char* argv[]) { Test obj; cout<<obj.DoIt(1); return 0; } Now, using the knowledge that a = 1 implies that...

Unrolling small loops with Visual Studio 2005

How do you tell the compiler to unroll loops based on the number of iterations or some other attribute? Or, how do you turn on loop unrolling optimization in Visual Studio 2005? EDIT: E.g. //Code Snippet 1 vector<int> b; for(int i=0;i<3;++i) b.push_back(i); As opposed to //Code Snippet 2 vector<int> b; b.push_back(0)...

kdtree implementation C++

Any recommendations for a C/C++ kd-tree? I'm looking for an existing implementation which the poster hopefully has worked with or has heard good things about. Also, I need to use this kd-tree to do a 1/2-NN search. ...

Find largest and second largest element in a range

How do I find the above without removing the largest element and searching again? Is there a more efficient way to do this? It does not matter if the these elements are duplicates. ...

Matrix Circular Shift

Does anyone know an efficient way to right circular-shift a matrix? Btw, the matrix is binary but a method to solve a non-binary matrix is also fine. Right now, I'm thinking of implementing a circular array for the rows of my matrix and updating each row whenever a shift operation is required. Another method, I was considering was impl...