c++

dictionary library in C++

Hi, I have to use write a program in which the dictionary should be used to check whether one string is a valid word in it. Is there any dictionary library I could use? If not, how could I construct a dictionary for query? Thanks! ...

Why does g++ generate multiple (weak) similar symbols ?

I'm looking at the output of nm -C 0804a86a W ForkMessageHandler::ForkMessageHandler() 0804a86a W ForkMessageHandler::ForkMessageHandler() 0804a6fa T ForkMessageHandler::~ForkMessageHandler() 0804a698 T ForkMessageHandler::~ForkMessageHandler() 0804a698 T ForkMessageHandler::~ForkMessageHandler() 0804a800 W MultiMessageHandler::MultiMe...

Trace large C++ code base?

Problem: I have just inherited this 200K LOC source code base. There's only a small part of it I need (and I want to rip all else out). What I would like to do is to be able to: 1) run the program a few times 2) have something (here's where you come in) record which lines of code gets executed 3) then rip out all the irrelevant l...

glReadPixels() really slow, better solution to get OpenGL coordinates from mouse position?

This is my code that i use to get my mouse position in the 3d scene: void GetOGLPos(int x, int y, GLdouble &pX, GLdouble &pY, GLdouble &pZ){ GLint viewport[4]; GLdouble modelview[16]; GLdouble projection[16]; GLfloat winX, winY, winZ; glGetDoublev(GL_MODELVIEW_MATRIX, modelview); glGetDoublev(GL_PROJECTION_MATRIX, projection); g...

Can't get DLL to work on Visual Studio.

I've been following the tutorial from msdn and it just doesn't work. First problem I have is that sometimes the .dll and .lib aren't built. Instead I only get .objs. Whenever I build the .dll project, it gives me a popup asking to "please specify the name of the executable file to be used for the debug session". I was told to change my ...

Resize Object in OpenGL

Hi. I'm new at OpenGL. Basically I want to know how to resize a rectangle. For example: I have a rectangle, height = 10, width = 20. I want the rectangle to grow 90 points up in 1 second for a new height of 100. Is there a function that can do this? Or I'll have to do it frame by frame? Thanks ...

validating numerical user input

I am creating a simple CLI calculator tool as an exercise. I need to make sure n1 and n2 are numeric in order for the functions to work; consequently, I would like to make the program quit upon coming across a predetermined non-numeric value. Can anyone give me some direction? Additionally, if anyone can offer any general tips as to h...

Mouse coordinates lags if CPU usage is not 100% - really weird!

When i make my program to use only 0-2% cpu (removed some CPU intensive opengl function), my mouse coordinates starts to lag! and when i use 100% CPU (when enabling the opengl function) i get nice and smooth mouse coordinates, note that the opengl function does nothing to my mouse coordinates. look at below image i recorded my rotation f...

iPhone Quartz 2d development using C++?

Could I write c++ code that interacts with the iPhone Quartz 2D framework, or can I only using objective-c? Thanks ...

Covert String to LPVOID and LPCWSTR in C++

Hi, I’m working with the winHTTP API in c++ and I have started to write a wrapper class for my application. For simplicity I have a number of functions that can take string parameters and use them in the winHTTP calls. However many of these require the data to be LPVOID or LPCWSTR. I can make it all work by making my wrapper functions ...

Generic member function pointer help

Hey, I've got a question about general member function pointers. I'm trying to achieve something similar to the following question How to define a general member function pointer Essentially what I want to be able to do is to register a member function pointer that accepts a generic Event object as its argument with a specific event typ...

what is a good way to read STL and boost documentation in emacs?

hi I am familiar with using info and man commands in emacs, however boost and default STL do not come with man or info pages, instead they come as HTML documentation. especially boost does not seem to have any documentation besides HTML (I could be wrong). Right now I am trying to put together w3m for quick searching of boost and STL d...

How do I call native C++ from C#?

I have a class implemented in C++ that's responsible for the arithmetic computation of the program, and an interface using WPF. I process the input with C# but then how can I use my C++ class? I've seen some comments about making a managed C++ wrapper class to interact with it, but I don't know where to start. Nor do I know how I'd go t...

Bad Pointer? - C++

Hi there, I'm writing a string tokenization program for a homework assignment in C++, that uses pointers. However, when I run & debug it, it says that my pointer pStart, is invalid. I have a feeling that my problem resides in my param'ed constructor, I've included both the constructor and the object creation below. I would appreciate it...

combination and permutation in C++

What's the most widely used existing library in C++ to give all the combination and permutation of k elements out of n elements? I am not asking the algorithm but the existing library or methods. Thanks. ...

How to call a function automatically?

Hi! I have rewrited a simple MFC application in MS Visual Studio 2008, and now it is working how i wanted. My only problem is, that i have to press a button, and i don't want. It should work automatically. I also noticed that the function are somehow called automatically. These function are called each after: CGetFileListDlg::...

Is there a way to ray cast with PhysX library without using a const NxRay?

I noticed that there are alot of funcitons that can raycast but they seem to use a const NxRay My problem I am having is having a vehicle that is casting a ray downwards as being my NxRay. It is not constant because the vehicle can move in different angles, but I want to beable to ray cast to find out the distance it takes to hit the gr...

AIO on OS X vs Linux - why it doesn't work on Mac OS X

My question is really simple. Why the code below does work on linux, and doesn't on Mac OS X. To compile save the file to aio.cc, and compile with g++ aio.cc -o aio -lrt on Linux, and g++ aio.cc -o aio on Mac OS X. I'm using Mac OS X 10.6.2 for testing on a Mac, and Linux kernel 2.6 for testing on Linux. The failure I see on OS X is ai...

how to read list of running processes on a remote computer in C++

What can be done to know and list all running processes on a remote computer? One idea is to have a server listening to our request on the remote machine and the other one is to use ssh. The problem is i dont know whether there will be such a server running on the remote machine and i cannot use ssh because it needs authentication. Is th...

Thread limit in Unix before affecting performance

I have some questions regarding threads: What is the maximum number of threads allowed for a process before it decreases the performance of the application? If there's a limit, how can this be changed? Is there an ideal number of threads that should be running in a multi-threaded application? If it depends on what the application is do...