I have a base class "Node" which contains a list of child nodes. Node defines a "forEachNode" function which takes a callback as a parameter and calls it on each node in the hierarchy.
I have a class derived from Node - "SpecialNode" (not really a name I'd choose - just an example!). Node knows nothing about SpecialNode.
I want to ite...
I know this has been discussed many times, but I am not sure I really understand why Java and C# designers chose to omit this feature from these languages. I am not interested in how I can make workarounds (using interfaces, cloning, or any other alternative), but rather in the rationale behind the decision.
From a language design persp...
I'm developing an application that gets large images from an Internet server which is the best way to download this images, without freeze the entire application? I mean background download. I have thought about download it in another thread.
...
Hi,
I have a large varbinary field in one of my tables, and I would like to download in parts for show a download progress indicator in my application.
How can I split the data sent in a SELECT query?
Thanks
...
Some loading routines in my program takes to long to complete. I want a quick small snippet for checking how long a function took to execute. By small I mean "preferably without 3rd party libraries".
Maybe something as simple as taking the system time?
start = current_system_time()
load_something()
delta = current_system_time()-start
l...
Hi every one,
When I compile my Windows application (called CrosslinesDetection) in Visual C++ 2005 including OpenCV 1.1, a computer vision library, I do not get any compile or link errors, but when I am running it, it gets to a point and freezes, and Windows says the following:
"Unhandled exception at 0x7c915223 in CrosslinesDetection...
Let's say we have
class A {
public:
virtual int foo() { cout << "foo!"; }
}
class B : public A {
public:
virtual int foo() =0;
}
class C : public B {
public:
virtual int foo() { cout << "moo!"; }
}
Is this really overriding? I think this is actually overloading.
What is the meaning of making something lik...
Hi
From some old c++ code im trying to use a com dll, it works fine when the dll is registered, but it crahses if the dll isnt registered.
// Initialize COM.
HRESULT hr = CoInitialize(NULL);
IGetTestPtr ptest(__uuidof(tester));
"Use method from the dll"
// Uninitialize COM.
CoUninitialize();
Is it anyway to check if the dll has bee...
Can I make an assumption that given
std::string str;
... // do something to str
Is the following statement is always true?
(str.empty() == (str == ""))
...
How to write a Reader/Writer lock with timeout, using conditional variables in C/C++?
...
I am taking a beginning c++ class, and would like to convert letters between hex representations and binary. I can manage to print out the hex numbers using:
for(char c = 'a'; c <= 'z'; c++){
cout << hex << (int)c;
}
But I can't do the same for binary. There is no std::bin that I can use to convert the decimal numbers to binary. H...
Hi everybody.
Is there a good C++ framework to implement XA distributed transactions?
With the term "good" I mean usable, simple (doesn't imply "easy"), well-structured.
Due to study reasons, at the moment I'm proceeding with a personal implementation, following X/Open XA specification.
Thank you in advance.
...
I'm trying to compile the following simple DL library example code from Program-Library-HOWTO with g++. This is just an example so I can learn how to use and write shared libraries. The real code for the library I'm developing will be written in C++.
#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>
int main(int argc, char **...
Is there a way of getting the position (index) of an item in a CTreeCtrl?
I am interested in the index of a node at its particular level.
I was thinking to maintain the item positions within the item "data" field, but the problem is that my tree is sorted and I cannot predict the position an item will receive (well, only if I sort the...
I'm sure I am just doing something really dumb and not seeing it but can anyone tell me why the following code would not be picking up changes in the passed in directory?
When calling this code, creating and modifying files or directories in the passed in m_directory is ignored. But if I call
PostQueuedCompletionStatus( m_hCompleti...
I'm trying to decipher CHtmlView's behaviour when files are dragged into the client area, so I've created a new MFC app and commented out the CHtmlView line that navigates to MSDN on startup. In my main frame, I've overridden CWnd::OnDropFiles() with a function that shows a message box, to see when WM_DROPFILES is sent.
OnDropFiles() g...
It seems to me that, in some ways, Java is where C was a while back. Both are fairly minimalist languages for their time, with relatively clean, simple cores to build on. (I'm referring to the core language here, not the libraries.) Both are/were extremely popular. Both are/were lingua francas, with tons of legacy code. Both are/wer...
how can i replace "\r\n" in an std::string
...
i want to know about the friend function and operator overloading in c++ and how they work? with program?
...
Hey!
I had this idea of creating a count down timer, like 01:02, on the screen (fullsize).
One thing is that I really don't have a clue on how to start.
I do know basic c/c++, win32 api and a bit of gdi.
Anyone have any pointers on how to start this? My program would be like making the computer into a big stopwatch (but with added fe...