I have a code base where many of the classes I implement derive from classes that are provided by other divisions of my company. Working with these other devisions often have the working relationship as though they are third party middle ware vendors.
I'm trying to write test code without modifying these base classes. However, there are...
For testing purposes, is there some place in the Visual Studio IDE where you can specify the command line parameters that you want sent to your startup project when it's launched from the IDE?
Thanks in advance for all your help!
...
I am using the MySQL C API within a C++ application. I have a column in my result set that is of the type MYSQL_TIME (part of mysql.h).
Is there a way to convert MYSQL_TIME to a char* or to a C++ string?
...
I compiled 2 different binaries on the same GNU/Linux server using g++ version 4.2.3.
The first one uses:
GLIBC_2.0
GLIBC_2.2
GLIBC_2.1
GLIBCXX_3.4
GLIBC_2.1.3
The second one uses:
GLIBC_2.0
GLIBC_2.2
GLIBC_2.1
GLIBCXX_3.4.9
GLIBCXX_3.4
GLIBC_2.1.3
Why the second binary uses GLIBCXX_3.4.9 that is only available on libstdc++.so.6.0...
In C/C++, if a multi-byte wide character (wchar_t) value is transmitted from a big-endian system to a little-endian system (or vice-versa), will it come out the same value on the other side? Or will the bytes need to be swapped?
...
Suppose I have a std::vector (let's call it myVec) of size N. What's the simplest way to construct a new vector consisting of a copy of elements X through Y, where 0 <= X <= Y <= N-1? For example, myVec [100000] through myVec [100999] in a vector of size 150000.
If this cannot be done efficiently with a vector, is there another STL da...
I can never remember how I do this because it comes up so infrequently for me. But in C or C++, what is the best way to read a character from standard input without waiting for a newline (press enter).
Also ideally it wouldn't echo the input character to the screen. I just want to capture keystrokes with out effecting the console screen...
I have a view which is derived from CEditView. It is read only. I would like to set the text as a kind of logging, but nothing shows up on the screen. If I inspect temp in the debugger after GetEditCtrl().GetWindowText(temp); I can see that the text is indeed changing internally, but I see nothing on the screen.
// HistoryView.cpp : ...
Hello,
I have two process and a shared memory zone, my workflow is like this. The process A write some data in the shared memory, after that it should wait and send a signal to other process B to start running. The process B should read some data from the shared memory do some stuff write the result, and send a signal to the process A t...
Hi,
I'm having problems allocating and deallocating my memory in a recursive C++ program. So without using an automatic memory management solution, I wonder if anyone can help me resolve the memory leak I am experiencing.
The following code essentially explains the problem (although it's a contrived example, please correct any mistakes...
I have some expressions such as x^2+y^2 that I'd like to use for some math calculations. On of the things I'd like to do is to take partial derivatives of the expressions. So if f(x,y) = x^2 + y^2 then the partial of f with respect to x would be 2x, the partial with respect to y would be 2y. I wrote a dinky function using a finite differ...
Is there a canonical or recommended pattern for implementing arithmetic operator overloading in C++ number-like classes?
From the C++ FAQ, we have an exception-safe assignment operator that avoids most problems:
class NumberImpl;
class Number {
NumberImpl *Impl;
...
};
Number& Number::operator=(const Number &rhs)
{
NumberIm...
Hi,
I'm trying to use the CRT memory leak detection but I keep getting the following message in Microsoft Visual Studio: "Detected memory leaks - skipping object dump." I can never get the it to actually do and object dump.
I followed the directions in the Microsoft article on Memory Leak Detection (http://msdn.microsoft.com/en-us/libra...
I have enjoyed the power of NDepend ( http://www.ndepend.com/ ) when writing C#, but in my C++ projects I have not found a comparable tool.
I use Visual Studio 2005, which has a class-view that covers some bases, but it is not powerful enough and doesn't work across project boundaries. I use Visual Assist X, which has some powerful refa...
I have a function inside a class that returns a reference to a member variable.
std::vector<uint8> & getBuffer() const
{
return m_myBuffer;
}
Now say in another class I call this method:
int someFunction()
{
std::vector<uint8> myFileBuffer = myFile.getBuffer();
}
This line calls the copy constructor of vector and makes me a l...
If I have a class as follows
class Example_Class
{
private:
int x;
int y;
public:
Example_Class()
{
x = 8;
y = 9;
}
~Example_Class()
{ }
};
And a struct as follows
struct
{
int x;
int y;
} example_struct;
Is the...
I am building an x64 lib in Visual Studio 2008, and separately linking it into an x64 DLL (specifically using the WDK Build.exe toolchain in this case). Most general C runtime symbols link fine, indicating that the library versions are sufficiently well-matched, but these two RTC_* symbols specifically fail. Forcing different runtime lib...
Basically, I want to have a std::list but with std::map properties such as find(), do I really need to loop through every single list entry to find what I need?
...
Simple question: do I have to 'delete' or 'delete []' c? Does the language matter?
char c[] = "hello"
...
I want to create a wrapper around another executable (ie - I have an executable that prints hello World, but I want the user to enter a password before the hello world executable is run). I don't want to edit the original executable's source.
I also want to encrypt the original executable (hello world in this example) and do not want to...