c++

Anti Cheat Client

I am trying to create an anti cheat client for counter strike source, and I dont really know where to start. What I am trying to do, is to take random screen shots at random intervals and upload them to a secure ftp. Also, prevent any 3rd party programs from injecting or hooking on to the application. Players will run the client, log in...

How can I copy sample data in SampleCB of directshow?

HRESULT GrabberCB::SampleCB(double SampleTime, IMediaSample *pSample) { //how to copy the pSample to memory for late use? } In fact I need to first store it to memory,and late share it with other applications via pipe. I'm pretty new to this, anyone knows? ...

Should clients have access to debug symbols for bug reporting purposes?

When shipping software to a client, should debug symbols (.PDBs) be bundled with it? If the client finds a bug or vulnerability in the software, a full stack trace (and a memory dump if possible) would be very helpful for the vendor in reproducing it. What are the pros/cons of giving clients debug symbols? ...

Defining static members in C++

Hi all ! I am trying to define a public static variable like this : public : static int j=0; //or any other value too I am getting a compilation error on this very line : ISO C++ forbids in-class initialization of non-const static member `j'. Why is it not allowed in C++ ? Why are const members allowed to be initiali...

Failure when retrieving string from the end of a file

I have a simple application which takes a text and password, generates a text writes it in a file then tries to retrieve it and decrypt it. Before the encryption the 'pad' is generated which is a string generated from the password with the length of the text. The problem comes in when I try to retrieve the text, because no matter how I t...

would the memory pointed by auto_ptr leak in case of neven ending application ?

Hi, I need to run an application in an embedded system continuously. While implementing this application, i need to allocate lot of memory from Heap. If i use auto_ptr for those, when will that be freed ? As per my understanding, memory pointed by auto pointers would be freed upon exiting/terminating the application. It would not be free...

Erlang - C and Erlang

I am building a program that mainly parses binary data and does some number crunching on it. It's primary goal is to do it all as quickly as possible. It will be running on an 8 - 32 core machine [Xeon / Sparc T2]. I choose erlang becasue I beleive that concurrency is much easier as opposed to c++. However, about halfway through I start...

Do you debug C++ code in VIM? How?

The question is to all you people, who use VIM to develop C++ apps. There was a period in my life, which can be described as 'I hate VIM!!!'..'VIM is nice!' However, having grown up mostly on MS Dev IDE, I've got used to those F5-F11 shortcuts when debugging code, watch window, call stack and the main code - all visible vithout need to ...

Is MFC only available with Visual Studio, and not Visual C++ Express?

Is MFC only available with Visual Studio, or is it also possible to use it with Visual C++ Express? ...

Getting File Associations using Windows API

I'm working on a console based file browser for Windows in C++ and am having difficulties getting together a context menu that lists actions associated with a file and calls commands on them. The biggest issue right now is getting the actions tied to the file types. I know of the process to open and tweak the registry keys in HKEY_CLASS...

Multiple return statements vs Multiple goto statements : which one would be preferable ?

Hi, I read that both multiple returns and multiple goto statements are bad programming practice. I have a function which can detect some 8 types of errors. In case of error, should i return error code or should i use goto statment to go to end of function and return from there. Whenever memory freeing is required before returning from f...

Mouse disappears on code break

I am using Ogre3D and sometimes when there is a break (or an exception) and it breaks into visual studio, my mouse cursor fails to appear. This is very annoying as most of the time I have to restart the game because I cannot watch any variables when it breaks. Everything else works, just the mouse disappears and stays that way until I pr...

Arbitrary number of nested-loops?

I'm looking to take an arbitrary number of lists (e.g. [2, 1, 4 . . .], [8, 3, ...], . . .) and pick numbers from each list in order to generate all permutations. E.g.: [2, 8, ...], [2, 3, ...], [1, 8, ...], [1, 3, ...], [4, 8, ...], [4, 3, ...], ... This is easily accomplished using nested for-loops, but since I'd like to it accept...

garbage character at end of string?

Hi there I'm reading a string and breaking each word and sorting it into name email and phone number. with the string joe bloggs [email protected] 12345. But once i break everything down, the individual separated variables which hold the name,email and phone number have garbage characters at the end of them. I cant figure out why. test f...

Calling a main-like function using argv[]

I have some code here to call minizip(), a boilerplate dirty renamed main() of the minizip program, but when I compile, I get undefined reference to `minizip(int, char*)*. Here's the code. int minizip(int argc, char* argv[]); void zipFiles(void) { char arg0[] = "BBG"; char arg1[] = "-0"; char arg2[] = "out.zip"; char arg3[] = "serv...

How to set read lock and write lock in directshow application?

To apply a general lock, I can do this: CAutoLock(CCritSec * plock) But how can I set read and write lock respectively? ...

[C++] getline returning empty string

I'm having problems with the getline instruction from fstream. this is a snippet from my code: boolean_1=true; while(true) { if(boolean_1) { //some stuff } else { save_file.open("save.txt", fstream::in); //some stuff save_file.close(); } mission_file.open(filename, fstream::in); ...

How to write a single function for creating dissimilar objects for dissimilar classes based on classname parameter ?

Hi, I need to write a function which could create any type object. It receives class name as parameter. If classes are similar, we can derive all those classes from a single base class and let function return Base *. User of the function could use runtime polymorphism to use the returned object. In this case, function looks like below. ...

Why do I need special libraries (binaries) built for each Visual C++ version?

There are a lot of C++ libraries (most?) that come with special binaries built for each Visual C++ version (2003, 2005, 2008, 2010). What's the problem about linking a C++ library built for Visual C++ 2008 with Visual C++ 2010? ...

Problem getting input from user

Here's the code : cout << "Please enter the file path: "; string sPath; getline(cin, sPath); cout << "Please enter the password: "; string sPassword; getline(cin, sPassword); Problem is, when I run it it displays "Please enter the file path: " then it displays "Please enter the password: " and then waits for the password. It seems to ...