c++

c++: header function not being linked properly from library into exe

I have a header file in a library (alibrary.lib). The library is a static library (.lib) and it links properly to exe. Now, I have a class: Vector3d. class Vector3d { void amethod() { blah } }; Vector3d cross(const Vector3d &v0, const Vector3d &v1) { float x,y,z; x = v0.y*v1.z-v0.z*v1.y; y = v...

Best tools to use to explore and develop Gnome projects?

I would like to get my feet wet contributing to Gnome projects. I've downloaded svn sources of various projects and tried to explore the code but obtaining a working understanding of any of the projects, even the simpler ones like Eye of Gnome, seems intractable. I admit, I am used to developing C/C++ in IDEs such as Eclipse CDT which...

Is there a favored idiom for mimicing Java's try/finally in C++ ?

Been doing Java for number of years so haven't been tracking C++. Has finally clause been added to C++ exception handling in the language definition? Is there a favored idiom that mimics Java's try/finally? Am also bothered that C++ doesn't have an ultimate super type for all possible exceptions that could be thrown - like Java's Throw...

simulated annealing for placement and routing

i am in need of a well documented source code of simulated annealing for placement and routing (in c++ or java). can anyone help me? ...

Alternative Keyword Representations

The C++ standard (ISO/IEC 14882:03) states the following (2.11/2): Furthermore, the alternative representations shown in Table 4 for certain operators and punctuators (2.5) are reserved and shall not be used otherwise: and, and_eq, bitand, bitor, compl, not, not_eq, or, or_eq, xor, xor_eq I have tried using these wit...

Keeping track of an objects local coordinate space

Ok, so - this is heavily related to my previous question Transforming an object between two coordinate spaces, but a lot more direct and it should have an obvious answer. An objects local coordinate space, how do I "get a hold of it"? Say that I load an Orc into my game, how do I know programatically where it's head, left arm, right arm...

Pure Virtual Method VS. Function Pointer

Hey all, Recently I've been designing a Thread class library, I've made a Thread abstract class like the following: class Thread { public: run() { /*start the thread*/ } kill() { /*stop the thread*/ } protected: virtual int doOperation(unsigned int, void *) = 0; }; Real thread classes would inherit this abstract class and ...

C++ equivalent of instanceof

What is the preferred method to achieve the C++ equivalent of instanceof? ...

In C++/CLR, what does a hat character ^ do?

I was reading Ivor Horton's Beginning Visual C++ 2008 and many of its CLR examples have int main(array<System::String ^> ^args) definition for main. I went back, page by page, to the beginning of the book to find first such instance with an explanation what it really means, but couldn't find one. Obviously it means the same as the st...

C++ using scoped_ptr as a member variable

Just wanted opinions on a design question. If you have a C++ class than owns other objects, would you use smart pointers to achieve this? class Example { public: // ... private: boost::scoped_ptr<Owned> data; }; The 'Owned' object can't be stored by value because it may change through the lifetime of the object. My view of it ...

How to determine the supported thread model of an out-of-process COM server?

Question: How to find the threading models supported by a predefined out-of-process (EXE-based) Server: Using oleview? Or any other valid methods? Note: Attempting to connect to the above described server to receive event notifications ...

What is static_case operator in C++?

I've heard of static_cast operator Recently I've come across static_case, for instance: *ppv = static_case<IUnknown> What does this mean? ...

A more natural boost::bind alternative?

Don't get me wrong: Boost's bind() is great. But I do hate to write&read code with it, and I've given up hope my coworkers will ever grok/use it. I end up with code like this: btn.clicked.connect(bind(&BetBar::placeBet, this, bet_id)); animator.eachFrame.connect(bind(&Widget::move, buttons[bet_id])); Which, while logical, is very fa...

How to efficiently implement an event loop?

COM Object (Server) sends event notification successfully to COM Client Without: ATL MFC How to efficiently get the main thread to wait/sleep (infinitely) until COM Server notifies the COM Client of a particular event? ...

A question about auto_ptr

template<class Y> operator auto_ptr_ref<Y>() throw() { return auto_ptr_ref<Y>(release()); } It is part of implementation of class auto_ptr in standard library. What does this means to do? Why there is an "auto_ptr_ref" between "operator" and "()"? ...

Writing a DirectPlay lobby server to establish regular TCP/IP connection

Greetings! Firs of all, I don't care much about DirectPlay per se, and am fully aware it's deprecated. However, I am currently looking into it for a quite simple reason: I love the way it's integrated in XP's built-in Windows Messenger 4.7 (the "old" one). Frankly, I greatly dislike Microsoft's move of removing the DirectPlay lobby clie...

DirectPlay8 only lists DirectPlay8 lobbyable apps

Hi, I know DirectPlay is deprecated and unintuitive, and thanks for wanting to inform me of that :) Now that we're done with that: DirectPlay8 example "Lobby Client" only lists the DP8 lobbyable applications (lobby servers), which is on my machine only "Microsoft Portrait". Is there a way to get it to list DP7 and older lobbyable appl...

How to check if an object construction is complete?

Have a class with couple of integers and a pointer , class A { int a; int b; char* s; public: ... class ConstructA { A &a; public: ConstructA (A& ta) : a(ta) {} ... }; }; As seen ConstructA is responsible for constructing object A. I want to write a me...

How do I design the structure a CAD package ?

Hi all, I am developing, in C++, a Computer Aided Design package for Printed Circuit Boards and Schematics (aka EDA CAD). It uses Lua for some specific things, but I would like to expand the role of Lua so that it implements much of the user interface logic. I would like to re-build the internals in a way which lets people change the ...

Getting gdb to save a list of breakpoints?

OK, info break lists the breakpoints, but not in a format that would work well with reusing them using the --command as in this question. Does gdb have a method for dumping them into a file acceptable for input again? Sometimes in a debugging session, it is necessary to restart gdb after building up a set of breakpoints for testing. E...