When RAII is not needed
Hi, Have you had any case when RAII wasn't the best method for resource management? Just couriosity... Thanks. ...
Hi, Have you had any case when RAII wasn't the best method for resource management? Just couriosity... Thanks. ...
Hi, We have a not very complicated but big (i.e. lots of files) Visual Studio C++ Win32 Console written in C++0x standard in VS2010. It does not use any non standard code or anything (Hopefully!). I now wanna port it to Linux. Which way is the quickest way to do it? autoconf? old-fashioned make file? any other solution? ...
I'm currently rewriting some existing technologies that were once using RSA Security's libraries into OpenSSL, but I'm starting to run into a few issues. Currently, all of the certificate verification code appears to be running without a hitch, until that is, I call SSL_connect(). Before, the call to SSL_connect() would produce SSL_ERR...
I experience quite annoying side-effect of class/structure padding with Purify. E.g. struct something { int field1; char field2; }; /* ... */ struct something smth, smth2; smth.field1 = 1; smth.field2 = 'A'; smth2 = smth; The last line would highly likely trigger UMR warning saying that 3 bytes of initialized memory are acc...
Hi All I'm writing a BHO that analyze the HTML taken from the 'onDocumentComplete' event of 'DWebBrowserEvents2'. Currently it works fine, unless I have a DHTML/AJAX page, where HTML handle is delivered too soon. For sample, I tried using it on 'http://www.google.com'. From the 'onDocumentComplete' event I can get most of the page but ...
I am getting this warning when compiling In file included from server.c:48: unixwin.h:23:1: warning: "IPPROTO_TCP" redefined In file included from server.c:42: /usr/include/netinet/in.h:45:1: warning: this is the location of the previous definition below is the sections refered to in the error: file unixwin.h 15 16 #ifndef FALSE 17...
I am working on a system that splits users by organization. Each user belongs to an organization. Each organization stores its data in its own database which resides on a database server machine. A db server may manage databases for 1 or more organizations. The existing (legacy) system assumes there is only one organization, however I ...
I'm converting a C++ application in C# and managing to work my way through most of it. However I'm stuck with the following statement: #define GET_SHCALL_ID(L) (((L) >> 24) & 0x000000FF) It's called by another part of the application that receives a Window Message and is passing in the lParam to this call, as...
My program uses a NetworkOutput object which can be used to write data to a remote server. The semantic is that in case the object is currently connected (because there is a remote server), then the data is actually sent over the socket. Otherwise, it's silently discarded. Some code sketch: class NetworkOutput { public: /* Constructs ...
Is there any problem with declaring a class with a static member which is another class in a header. E.g: class Stat { public: int avar; Stat(); }; class Test { public: static Stat stat; }; The reason I fear it might cause problems is that it seems very similar to declaring a global variable in a header. If included in tw...
while I am creating a c++ header file, I declare the header file like; /*--- Pencere.h ---*/ #ifndef PENCERE_H #define PENCERE_H I want to learn that why do I need to write underline. ...
According to C++ Standard, a reinterpret_cast of a pointer T* to some other type pointer Q* can change or not change the pointer value depending on implementation. I'm very interested - it there any real example of a C++ implementation where casting a pointer to some other pointer type with reinterpret_cast changes the pointer? What and...
Hi, I am trying to get the statusbar to update with the FPS of the contents of a QGLWidget. I have connected them as follows (In class MainWin): glWidget = new GLWidget; ui.verticalLayout->addWidget(glWidget); connect(glWidget, SIGNAL( updateFPSSignal(float) ), this, SLOT( updateFPSSlot(float) )); } The ...
Hello gurus, I am compiling some external C++ code into a dll using Visual Studio 2008. The code is wrapped in extern "C". Since I am cross compiling, creating a 64 bit dll on my 32 bit machine; I am using x64 as "Active solution platform" in the "Configuration Manager". My dll compiles and links successfully. However when I open it ...
I'm trying to compile this source code : // exception_set_unexpected.cpp // compile with: /c /EHsc #include<exception> #include<iostream> using namespace std; void unfunction( ) { cout << "I'll be back." << endl; terminate( ); } int main( ) { unexpected_handler oldHand = set_unexpected( unfunction ); unexpected( ); } ...
I'm confronted with the task of making a C++ app scriptable by users. The app has been in development for several years with no one wasting a thought on this before. It contains all sorts of niceties like multithreading, template wizardry and multiple inheritance. As the scripting language, Python is preferred, but Lua might be accepted ...
I have the following XML file: <xml version="1.0" encoding="utf-8"?> <Data> <Parameter1>1</Parameter1> </Data> I want to add a new node: Parameter2="2" to the Data node. This code doesn't work, saved file still contains only one parameter: boost::property_tree::ptree tree; boost::property_tree::ptree dataTree; read...
I've created my controls in my window in the WM_CREATE message like this: case WM_CREATE: { CreateWindowA("button", "Refresh Listview", BS_MULTILINE | WS_CHILD | WS_VISIBLE, 10, 10, 70, 50, hwnd, (HMENU)IDC_REFRESHLW, g_hInst, NULL); break; } When I press tab it does nothing, do i have to in...
Hi, I was trying to solve a copy ctro qs given in lipman n not sure If i got it right. Since the class has pointers to itself it confused me a bit. Here is the code #include <iostream> #include <string> using namespace std; class BinStrTreeNode{ public: BinStrTreeNode(const string& val):_val(val){ _leftc...
Hi, here is a sample code. If I remove the stdafx.h file, the program wont compile. stdafx.h file '#pragma once '#include "targetver.h" '#include <stdio.h> '#include <tchar.h> Capture.ccp // Capture.cpp : Defines the entry point for the console application. // '#include "stdafx.h" '#include "string.h" '#include "cv.h" '#include "...