Building an app for Ubuntu using Ogre3D, CEGUI, OIS which is now all compiling and running as expected. Having got the basic app running I decided to now build a custom config file which I can store both graphics settings (ie. resolution, fullscreen, etc) as well as other configurable settings I will need in the app down the track.
As a...
Hey guys,
I need to get the protocol version of an application, and I don't know too much about the inner workings of detouring. I usually use a detour class written by a friend of mine (Not windows detour, as this works on win/linux) but im wondering if anyone can give me some insight on how to retrieve the value of a global pointer? I...
I know that VS2008 supports all, general C++, Managed C++ & C++/CLI.
What will be the default nature of VS2008? If I don't say anything then which C++ (C++, Managed C++ & C++/CLI.) will it use? Is it general C++? or Managed or CLI version?
I just want to do regular C++ programming. Not managed or CLI. So, I want to change settings appr...
Hi,
My c code uses 'memset' and 'close'.
And I have added:
#include <stdio.h>
#include <glib.h>
#include <stdlib.h>
But I still get these warnings:
main.c:259: warning: implicit declaration of function ‘memset’
main.c:259: warning: incompatible implicit declaration of built-in function ‘memset’
main.c:268: warning: implicit declarat...
I have a QListWidget containing items which have icons and when the items are selected the icon is just highlighted out. Is there a way to prevent this? I can't use stylesheets because it's for an embedded application and including them takes up too much space.
thanks
...
Hi,
I'm a programming student with two classes in C#, but I'm just taking my first class in C++, and thus I'm being exposed to pointers.
I know how they work, and the proper way to use them, but I wondered about some of the ways that professional programmers use pointers in their programs.
So how do you use pointers? Or do you?
Thi...
I have hooked WM_SETFOCUS message by calling API
hhookCallWndProc = SetWindowsHookEx(WH_CALLWNDPROC, HookCallWndProc, hInst, threadID);
Hook Procedure is
extern "C" LRESULT _declspec(dllexport) __stdcall CALLBACK HookCallWndProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode == HC_ACTION) {
CWPSTRUCT* info ...
I have few questions on the best practices of using shared_ptr.
Question 1
Is copying shared_ptr cheap? Or do I need to pass it as reference to my own helper functions and return as value? Something like,
void init_fields(boost::shared_ptr<foo>& /*p_foo*/);
void init_other_fields(boost::shared_ptr<foo>& /*p_foo*/);
boost::shared_ptr<...
I am planing to develop on Symbian systems but I am not familiar with it. I know (might be) the most popular way of developing on Symbian is Symbian C++, and I also heard of Qt. What's the difference between them? If I want my app run on most of the Symbian systems, which should I choose?
Can someone give me some overall advices?
Thank ...
I have been coding in C++ for the last 6 years. But there is one question that I have not been able to figure out. I want to ask, are all temporaries in C++, rvalues?
If no, can anyone provide me an example where temporary produced in the code is an lvalue?
...
I've heard and read many times that's better to catch an exception as reference-to-const rather than as reference. Why is
try {
// stuff
} catch (const std::exception& e) {
// stuff
}
better than
try {
// stuff
} catch (std::exception& e) {
// stuff
}
...
Hello all
correct me if i wrong but i don't know any solution in c++ that is similar to java persistent hibernate
is there ?
...
Hi,
I'm currently trying to implement a factory as a singleton. I practically used the textbook example of the Singleton pattern. Here's the .h file:
namespace oxygen{
class ImpFactory{
public:
static boost::shared_ptr<ImpFactory> GetInstance();
private:
static boost::shared_ptr<ImpFactory> mInstance;
};
and here's the .cp...
Hi there,
I am going to develop on Symbian (S60), and I know there are some ways to develop on this platfrom: Symbian C++, Java ME, Qt,OVI etc.
I need an overall brief guide on all the ways and I have a few questions:
What's the difference between Symbian C++ and Jave ME when developing?
If Java ME can run on Symbian ,why we need Sy...
what is a way to create a my own operating system using c++. I have been created boot loader (using nasm,qemu) but I haven't knowledge to add an kernel to this boot loader.
...
I was explaining OOP to my friend. I was unable to answer this question. (How shameful of me? :( )
I just escaped by saying, since OOP depicts the real world. In real world, Parent's can accommodate children but children cannot accommodate parents. same is the case in OOP.I know its stupid. :P
class Parent
{
int prop1;
int prop2;
...
I'm trying to insert some pair value into a map. May map is composed by an object and a vector of another object. i don't know why but the only way to make the code to compile is to declare the first object like a pointer. But in this way when I insert some object, only the first pair is put into the map.
My map is this:
map<prmEdge,v...
I have the following class:
class MyClass {
public:
MyClass( char* what ) : controlled( what ) {}
~MyClass() { delete[] controlled; }
operator char*() const { return controlled; }
operator void*() const { return controlled; }
operator bool() const { return controlled != 0; }
private:
char* controlled;
};
This is com...
Hello All!
Recently I've been working on a C++ prime generator that uses the Sieve of Atkin ( http://en.wikipedia.org/wiki/Sieve_of_atkin ) to generate its primes. My objective is to be able to generate any 32-bit number. I'll use it mostly for project euler problems. mostly it's just a summer project.
The program uses a bitboard to...
Let's say I have two classes Foo and Bar, and I want to make Foo friends with Bar without changing Foo. Here's my attempt:
class Foo
{
public:
Foo(){}
private:
void privateFunction(){}
};
template <class friendly, class newFriend>
class friends : public friendly
{
private:
friend newFriend;
};
cla...