When I'm developing in C#, I heavily use GhostDoc to speed up the process of commenting my code. I'm currently working on a C++ project and I haven't found an equivalent tool. I know about Doxygen, but from what I know it is used to create documentation outside the code, not comments in the code. Are there any good equivalent tools? I wo...
I know there are only a few CAA Programmers in the world but I try it anyway...
I can't get keyboard events to work. I found this code which looks reasonable but the Notification doesn't fire.
AddAnalyseNotificationCB(CATFrmLayout::GetCurrentLayout()->GetCurrentWindow()->GetViewer(),
CATKeyboardEvent::ClassName(),
(CATComma...
I want to use this snippet from Mr-Edd's iostreams article to print std::clog somewhere.
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
int main()
{
std::ostringstream oss;
// Make clog use the buffer from oss
std::streambuf *former_buff =
std::clog.rdbuf(oss.rdbuf());
std::clog <<...
I'm trying to encapsulate some functions from the C socket library into my own C++ class. I'd like to define a member function that uses the same name as its corresponding C function, but with a different signature. For example, I'd like to write the function
ssize_t MyClass::write(const void *buf);
which makes a call to
ssize_t wr...
I'm a moderately experienced Java / C# programmer, and I've recently started learning C++. The problem is, I'm having trouble understanding how to structure the various header and code files. This seems mostly due to my lack of understanding as to how the compiler links everything together. I've tried reading some textbooks, but my preco...
hi,
I have following questions regarding strings in C++
1>> which is a better option(considering performance) and why?
1.
string a;
a = "hello!";
OR
2.
string *a;
a = new string("hello!");
...
delete(a);
2>>
string a;
a = "less";
a = "moreeeeeee";
how exactly memory management is handled in c++ when a bigger string is copie...
I have a Subject which offers Subscribe(Observer*) and Unsubscribe(Observer*) to clients. Subject runs in its own thread (from which it calls Notify() on subscribed Observers) and a mutex protects its internal list of Observers.
I would like client code - which I don't control - to be able to safely delete an Observer after it is unsub...
I'm pretty perplexed... I've got 5 different test computers, all relatively blank Windows XP machines running similar hardware specs. I run a silent install of the FireBird (Classic) database and my application. Some computers require "localhost:" (or 127.0.0.1) before the database location to make a connection, and some simply don't wor...
So I have this very simply SDL application I want to be able to pass to my friend without having him download a whole bunch of SDL packages.
how can I go about this? I was told to use this line to compile:
(note that I use ubuntu linux and so does my friend, and that this application compiles and runs without the "-Wl,-Bstatic" options...
Currently we use gcov with our testing suite for Linux C++ application and it does a good job at measuring line coverage.
Can gcov produce function/method coverage report in addition to line coverage?
Looking at the parameters gcov accepts I do not think it is possible, but I may be missing something. Or, probably, is there any other ...
I'm developing a small windows app using c++ and i would like to get some kind of fingerprint of the software/hardware on a pc so that i can allow the app to be run only on certain pc's.
I am aware that the app can be cracked but i'm really interested in implementing something like this.
Any ideas how could i achieve this?
...
I have a piece of code that brings the window under the cursor to the foreground using the SetForegroundWindow API for WinXP. I have been testing it for Vista but the API seems to no longer do the job correctly.
AllowSetForeground did not help, my process is a background process.
What can I use to accomplish this?
...
For new and completely revised tricks and dark corners of STL go here: Hidden Features and Dark Corners of STL
I've been using more "modern" c++ constructs for a while, but kind of superficially and not everywhere. I'm looking for open source projects to study that are good examples of Modern C++ and STL usage.
Things like what is sugg...
I have a CToolbar and within it I have a button with style BTNS_BUTTON|BTNS_DROPDOWN. I would like to make it a split button, so the left side of the button is a button, and the right side has a drop down menu.
To complete this, I create the button then I call ::SendMessage like so:
::SendMessage( hwndForButton, TB_SETEXTENDEDSTYLE, 0...
The original title here was
Workaround for SFINAE bug in VS2005 C++
This is tentative use of SFINAE to make the equivalent for the is_pod template class that exists in TR1 (In VS2005 there's no TR1 yet). It should have its value member true when the template parameter is a POD type (including primitive types and structs made of them) an...
Hi, everyone,
what is the difference between global variable and file variable in C++?
Thanks!
...
I have a C++ class that compiles fine on linux with gcc and on widows in visual studio.
boid.h:
#ifndef BOID_CLASS_HEADER_DEFINES_H
#define BOID_CLASS_HEADER_DEFINES_H
#include "defines.h"
class Boid {
public:
// Initialize the boid with random position, heading direction and color
Boid(float SceneRadius,float NormalVel);
...
Just started programming in C++.
I've created a Point class, a std::list and an iterator like so:
class Point {
public:
int x, y;
Point(int x1, int y1)
{
x = x1;
y = y1;
}
};
std::list <Point> pointList;
std::list <Point>::iterator iter;
I then push new points onto pointList.
Now, I'm needing to ite...
I know find method finds the supplied key in std::map and return an interator to the element. Is there anyway to find the value and get an iterator to the element? What I need to do is to check specified value exist in std::map. I have done this by looping all items in the map and comparing. But I wanted to know is there any better appro...
What is the best free windows c++ compiler, ideally cross-platform. I've tried Bloodshed, Ganymede, EasyEclipse, Visual C++ express. Visual C++ express is the only one I've been able to get the debugger working on!
...