Hi all
I wrote a small test program with a sample class containing also self-defined constructor, destructor, copy constructor and assignment operator. I was surprised when I realized that the copy constructor was not called at all, even though I implemented functions with return values of my class and lines like Object o1; Object o2(o1...
In a service, I try to use the following code to launch a program :
HANDLE hPipe;
HANDLE hToken;
PROFILEINFO stProfileInfo;
char szUserName[64];
DWORD dwUserNameSize = 64;
// Take the identity of the client
ImpersonateNamedPipeClient(hPipe);
// Retrieve the user name (DOMAIN\USER)
GetUserNameEx(NameSamCompatible,szUserName,&dwUserName...
Hi,
I'm fixing a C++ Builder 5 application and I have this code:
void __fastcall TFPrincipal::DBGModuleStartDrag(TObject *Sender,
TDragObject *&DragObject)
{
m_pParentNodesDragDrop = NULL;
DragObject = NULL;
bool bAbort = false;
m_ListaModulosDragDrop->Clear();
m_ListaContenedoresDragDrop->Clear();
CInfoNode *pInfoN...
What do people mean when they say this? What are the implications for programmers and compilers?
...
I have an array of doubles and need to do a calculation on that array and then find the min and max value that results from that calculation. Here is basically what I have:
double * array;
double result;
double myMin;
double myMax;
// Assume array is initialized properly...
for (int i = 0; i < sizeOfArray; ++i) {
result = transmog...
I am looking for lightweight multi-threading framework for C++. I found POSIX Threads.
Please, share you practical experience with POSIX threads: before I start with it I want to know its pros and cons from real people, not from wiki.
If you practically compared it with anything (maybe, better), it would be interesting to know either.
...
I'm currently implementing a radix tree/patricia trie (whatever you want to call it). I want to use it for prefix searches in a dictionary on a severely underpowered piece of hardware. It's supposed to work more or less like auto-completion, i. e. showing a list of words that the typed prefix matches.
My implementation is based on this ...
I've been banging my head fruitlessly against the wall attempting to include boost's thread functionality in my Eclipse C++ project on Ubuntu.
Steps so far:
Download boost from boost.org
./configure --with-libraries=system,thread
make
sudo make install
sudo ldconfig -v
In the eclipse project, set the include directory to:
/usr/loc...
Just want to document the answer to this specific question... a similar question (with potential answers was asked here)
All platforms welcome, please specify the platform for your answer.
...
int qempty(){ return(f==r)?1:0;}
In the above snippet, what does "?" mean? What can we replace it with?
...
An unmanaged C++ dll has an exported function, that takes an int type as window hanlde
void SetWindowHandle(int nHandle);
else where in the unmanaged dll code the int is casted to HWNDand is used properly.
And from the windows forms application, I set the handle as follows
_hHandle = this->Handle.ToInt32();
m_pViewer->SetWindowHandl...
I have a dll "mytest.dll" that when loaded via LoadLibrary(), returns NULL (and 127 as the GetLastError()). If I use DependencyWalker on "mytest.dll", it reports that it should load correctly and that all DLLs are found correctly. Running the profiler option of DependencyWalker on the host exe gives me this relevant section in the log:...
I've been going deeper into C++ recently and my bugs seem to get complex.
I have a vector of objects, each object contains a vector of floats. I decided I needed to create a further flat array containing all the float values of all objects in one. It's a little more complex than that but the gist of the problem is that as I loop throu...
I have experience developing MFC applications with C++ using Visual Studio 6.0. You can guess how long ago that was (hint: going on 10 years). I am trying to update my skills but a lot has changed. How would one go about bringing these skills up to date?
...
Most likely a really simple question, please keep any answers easy to understand I'm still quite new at this:
I'm making a little app, and I need to use powers for a couple of calculations. After a little research I found the pow function in cmath, and have had a play. In the end i came up with this snipped, which works:
#include <iost...
Hello. I'm learning C++ and I'm still confused about this. What are the implications of return a value as constant, reference and constant reference in C++ ? For example:
const int exampleOne();
int& exampleTwo();
const int& exampleThree();
...
I'm trying to find a way to test how long it takes a block of C++ code to run. I'm using it to compare the code with different algorithms and under different languages, so ideally I would like a time in seconds / milliseconds. In Java I'm using something like this:
long startTime = System.currentTimeMillis();
function();
long stopTime...
I'm writing a function using ICU to parse an Unicode string which consists of kanji numeric character(s) and want to return the integer value of the string.
"五" => 5
"三十一" => 31
"五千九百七十二" => 5972
I'm setting the locale to Locale::getJapan() and using the NumberFormat::parse() to parse the character string. However, whenever I pass...
The following code of mine compute
the confidence interval using Chi-square's 'quantile'
and probability function from Boost.
I am trying to implement this function as to avoid
dependency to Boost. Is there any resource where can I
find such implementation?
#include <boost/math/distributions/chi_squared.hpp>
#include <boost/cstdint.hpp...
Hi,
Last term (August - December 2008) me and some class mates wrote an application in C++. Nothing spectacular, it is an ORM for Sqlite3. We implemented some stuff like reflection to make it work and release the end user from the ugly stuff. Personally, i think we made a nice job, and that our ORM could actually be useful for someone (e...