I have a very large project with tons of convoluted header files that all include each other. There's also a massive number of third-party libraries that it depends on. I'm trying to straighten out the mess, but I'm having some trouble, since a lot of the time I'll remove one #include directive only to find that the stuff it was includ...
Hi,
when I use SQL*Plus, connecting to a user whose password entered the grace period (Oracle 11g, Oracle 8i), I get an error message but the connect is still successful:
SQL*Plus:
=====================================
SQL> connect gumiplesku
Enter password:
ERROR:
ORA-28002: the password will expire within 7 days
Connected.
SQL> se...
Im trying to text serialize and deserialize an object containing a container of abstract objects in c++,does somebody know of a code example of the above?
...
Here's some code (full program follows later in the question):
template <typename T>
T fizzbuzz(T n) {
T count(0);
#if CONST
const T div(3);
#else
T div(3);
#endif
for (T i(0); i <= n; ++i) {
if (i % div == T(0)) count += i;
}
return count;
}
Now, if I call this template function wit...
I was looking through the DXUTCore project that comes with the DirectX March 2009 SDK, and noticed that instead of making normal accessor methods, they used macros to create the generic accessors, similar to the following:
#define GET_ACCESSOR( x, y ) inline x Get##y() { DXUTLock l; return m_state.m_##y;};
...
GET_ACCESSOR( WCHAR*, W...
This may have been answered elsewhere but I could not find a suitable response.
I have this code:
enum enumWizardPage
{
WP_NONE = 0x00,
WP_CMDID = 0x01,
WP_LEAGUES = 0x02,
WP_TEAMS = 0x04,
WP_COMP = 0x08,
WP_DIVISIONS = 0x10,
WP_FORMULAS = 0x20,
WP_FINISHED = 0x40,
};
Which is legacy and I have...
This is best described in pseudo-code:
class Thing {};
interface ThingGetter<T extends Thing> {
T getThing();
}
class Product extends Thing {};
class ProductGetter<Product> {
Product getThing() {
// Some product code
}
}
class SpecialProductGetter extends ProductGetter {
Product getThing() {
p = Produ...
I'm creating an effect using
hr = D3DXCreateEffectFromFile( g_D3D_Device,
shaderPath.c_str(),
macros,
NULL,
0,
NULL,
&pEffect,
&pBufferErrors );
I would like to get all the uniforms that this shader is using. In OpenGL I used glGetActiveUniform and glGetUniformLocation to...
I'm having some trouble compiling/linking a set of classes, several of them dealing with a common global variable.
Basically, I declare and define a extern variable foo in class A and access/update it in classes B and C.
The relevant code looks like this:
A.h
extern string foo; // declare it <=== compiler error "storage class sp...
How do you test for wanted raised compiler errors in unit testing?
Consider the code:
class ErrorTest
{
OtherClass& read_write() {
return other;
}
const OtherClass& read_only() const {
return other;
}
private:
OtherClass other;
};
How can I test for read_only() assignment? It's really imp...
Currently, I use MSAA to get an IHTMLDocument2 object from a IE HWND. However, with some complicated web applications, this IHTMLDocument2 object may contain serveral IHTMLDocument2 objects, some of them are not belong to the current displaying page, but the previous page.
It seems to me, IE sometimes doesn't refesh its DOM object, but...
We're about to commit to Qt and C++ (sigh) to do some cross-platform development. The latest version of Qt 4.5 seems very nice as does the QT Creator IDE, which although simple compared to other IDEs, is a good way to get started.
I'm trying to understand how to do drag and drop into QT widgets from the "outside" world. As far as I can ...
If you have a header file named ThisIsAHeaderFile.h, the following will still locate the file in Visual Studio:
#include <ThisIsAheaderFile.h>
Is there a way to enforce case sensitivity so that the #include will result in an error?
...
Hi,
I am trying to formalize my programming practices in preparation to do it professionally (I have been doing it as a hobby for 18 years). Unfortunately they didn’t really teach us useful stuff in school, so I am trying to learn these things on my own. One aspect that I am trying to learn is unit-testing.
I have read various things a...
Possible Duplicate:
The Definitive C++ Book Guide and List
Ok, I've had one semester of C++ and will be taking a second semester in it after I have taken a Data Structure class this fall. In the first class, we dealt mainly with C++ syntax and the textbook we used was ok, but now I'm wanting to go ahead and purchase a great C+...
I'm getting an Undefined reference error message, on this statement:
GlobalClass *GlobalClass::s_instance = 0;
Any ideas? Code is shown below:
================================================
#ifndef GLOBALCLASS_H_
#define GLOBALCLASS_H_
#include <string>
class GlobalClass {
public:
std::string get_value();
void set_valu...
Possible Duplicate:
Undefined reference - C++ linker error
Now, I'm getting an "Undefined reference error message to 'GlobalClass::s_instance', and 'GlobalClass::instance()', respectively on these statements:
GlobalClass *GlobalClass::s_instance = 0;
GlobalClass::instance()->set_value(myAddress); \\ <== undefined reference ...
When should your C++ object's destructor be virtual?
...
template<class T>
class Set
{
public:
void insert(const T& item);
void remove(const T& item);
private:
std::list<T> rep;
}
template<typename T>
void Set<T>::remove(const T& item)
{
typename std::list<T>::iterator it = // question here
std::find(rep.begin(),rep.end(),itme);
if(it!=rep.end()) rep.erase(it);
}
Why t...
I'm writing a library for manipulating bond graphs, and I'm using the Boost Graph Library to store the data for me. Unfortunately, I can't seem to figure out how to implement a proper visitor pattern using it, as you can't subclass out vertices - you must rely on 'properties' instead. The visitor framework provided in the library seems...