visual-c++-2005

Preventing a complete rebuild using branches with GIT and Visual Studio 2005

One of the problem I faced when using branches in GIT was that it was very easy when switching branches to cause visual studio 2005 to cause a complete rebuild of the source because of the time/date being changed when switching branches. My typical layout is this. svn/remote master test When switch between either the test and the maste...

New keywords and new type of pointers in Visual C++ 2005. What is managed C++?

Possible duplicates What is gcnew? What does the caret mean in C++/CLI? Difference between managed c++ and c++ I am a advanced C++ programmer with g++. But currently I am working on Visual C++ 2005 doing Windows Forms Application programming . But I am finding it hard with its new terminology. For e.g. instead of new it has gc...

Including header files in Visual Studio

Suppose I have a solution with 3 projects X,Y, and E. E will generate an executable and X and Y will generate static libraries such that Y includes the header files of X and E includes the header files of Y. Now, my question is: why do I have to include the directory of the header files of X in E? ...

Profiler for Visual C++ 2005

Any recommendations for gratis (i.e. free as in free beer) profilers which can be integrated with Visual C++ 2005? I'm using Very Sleepy right now (which is really nice), but wouldn't mind shifting if there were a better option. ...

Maximize CPU Usage

How do I maximize the CPU usage for my application? I tried setting it to "Real-time" in the Task Manager, but there was no noticeable improvement - it's stuck at 50%. I'm working in Windows XP with Visual C++ 2005. ...

OpenMP: Causes for heap corruption, anyone?

EDIT: I can run the same program twice, simultaneously without any problem - how can I duplicate this with OpenMP or with some other method? This is the basic framework of the problem. //Defined elsewhere class SomeClass { public: void Function() { // Allocate some memory float *Data; Data = new float[1024]; // Dec...

Which version of boost should I use with c++ visual-studio-2005?

Does anyone know what version of the Boost Library to use with Visual Studio 2005? ...

SSE2 Compiler Error

I'm trying to break into SSE2 and tried the following example program: #include "stdafx.h" #include <emmintrin.h> int main(int argc, char* argv[]) { __declspec(align(16)) long mul; // multiply variable __declspec(align(16)) int t1[100000]; // temporary variable __declspec(align(16)) int t2[100000]; // temporary variable __m128i mul...

SSE2 - 16-byte aligned dynamic allocation of memory

EDIT: This is a followup to SSE2 Compiler Error This is the real bug I experienced before and have reproduced below by changing the _mm_malloc statement as Michael Burr suggested: Unhandled exception at 0x00415116 in SO.exe: 0xC0000005: Access violation reading location 0xffffffff. At line label: movdqa xmm0, xmmword ptr [t1+...

Add the upper and lower 64-bits of a 128-bit xmm register

I have two packed quadword integers in xmm0 and I need to add them together and store the result in a memory location. I can guarantee that the value of the each integer is less than 2^15. Right now, I'm doing the following: int temp; .... movdq2q mm0, xmm0 psrldq xmm0, 8 movdq2q mm1, xmm0 paddq mm0,mm1 movd temp, mm0...

How to ensure vsvars32.bat has run

I have a build process using MSVC 2005. It only works correctly if run from a Visual Studio command prompt, not from a regular command prompt, because of the additional variables that get set. It's far too easy to run the wrong type of prompt and then get obscure error messages, so I'm trying to avoid this. I don't want to change my regu...

SSE2 - "The system cannot execute the specified program"

I recently developed a Visual C++ console application which uses inline SSE2 instructions. It works fine on my computer, but when I tried it on another, it returns the following error: The system cannot execute the specified program Note that the program worked on the other computer before introducing the SSE2 code. Any suggestions? ...

How do I let a program D read a memory location within the memory allocated to a program A?

So I'd like to let read D read this memory location and do some work on it. Any thoughts? Is writing a debugger extension the only way - if so, any recommendations? I considered executing a memory dump to file (still don't know how, AFAIK I can only view memory in a window) and letting D work on the file, but is there a better way? ...

RtlpNtMakeTemporaryKey - VerySleepy indicates that this takes a lot of time

I'm profiling some computationally intensive code of mine, and was surprised to see that the function RtlpNtMakeTemporaryKey takes up a huge chunk of time. It's module is ntdll and the source file is Unknown. Is this a call which is waiting for my slow function to terminate or is it something which I can optimize? ...

Local classes inside inline non-member function produces LNK2005 with MSVC2005

Apparently, MSVC2005 fails to inline local classes' member functions which leads to LNK2005. I'm facing this LNK2005 error when compiling the following: common.h content: inline void wait_what() { struct wtf { void ffffuuu() {} } local; } foo.cpp content: #include "common.h" void foo() { wait_what(); } bar.cpp conte...

Pthreads in Visual C++

I'm experimenting with multithreading in Windows and was wondering whether I should use Win32 API use POSIX Threads for Windows Learning Pthreads would be useful if I tried to develop such applications on different platforms - but am I losing anything by not learning Win32 API? Or are both similar enough so that learning one allows m...

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

MFC: 'Gluing' two windows/dialogs together

I'm trying to set something up so my main dialog has one or more child dialogs, and these are glued/docked to the outside of the main dialog - when the main dialog is minimised, the children are too, when main dialog moves, children move with it. I'd tried setting child dialogs as having main dialog CWnd as parent, with CHILD style. But...

False sense of security with `snprintf_s`

MSVC's "secure" sprintf funcions have a template version that 'knows' the size of the target buffer. However, this code happily paints 567890 over the stack after the end of bytes... char bytes[5]; _snprintf_s( bytes, _TRUNCATE, "%s", "1234567890" ); Any idea what I do wrong, or is this a known bug? (I'm working in VS2005 - didn't t...

show two detail section's data in crystal report

How can display two detail section's data after completion of first detail section in crystal report of vb2005 like detail of first detailsection #one row.........................." #second row........................." #three row.........................." detail of second detailsection #"one row.............." #"second row..........