c++

undecorate function names with visual studio sdk

To undecorate mangled C++ names that Visual Studio generates, you can use undname.exe. But what if you want to avoid the overhead of creating a full-blown process every time you need undecoration? Is there any equivalent functionality in the Visual Studio SDK (should be supported in VS2005)? ...

problem in conversion rsa private key in descriper in symbian

i want to store RSA public key and private key in database iRSAKeyPair = CRSAKeyPair::NewL(aModulusBits, EStandardCRT) ; const CRSAPublicKey &iRSAPublicKey =iRSAKeyPair->PublicKey() ; const CRSAPrivateKey &iRSAPrivateKey =iRSAKeyPair->PrivateKey(); but there is no datamember in CRSAPrivateKey for conv in descripter is there any way...

Easy check for unresolved symbols in shared libraries?

I am writing a fairly large C++ shared-object library, and have run into a small issue that makes debugging a pain: If I define a function/method in a header file, and forget to create a stub for it (during development), since I am building as a shared object library rather than an executable, no errors appear at compile-time telling me...

OpenGL alpha transparency

Hey everyone, I am starting to use opengl and I wanted to try alpha transparency. Here's my code: void display(void); int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE|GLUT_RGBA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable( GL_BLEND ); glutInitWindowSize(600,...

Member function overriding accross class hierarchy

I have defined a class A and derived a new class B from A . I have overloaded SetData() funtion in class B. When i tried to access SetData funtion of class B using object of B ,compiler doesn't permit it. why is it so ? class A{ public : void SetData(); }; class B : public A { public: void SetData(int); }; B b...

Casting string type with GetDlgItemText() for use as string buffer in C++

I am stumped by the behaviour of the following in my Win32 (ANSI) function: (Multi-Byte Character Set NOT UNICODE) void sOut( HWND hwnd, string sText ) // Add new text to EDIT Control { int len; string sBuf, sDisplay; len = GetWindowTextLength( GetDlgItem(hwnd, IDC_EDIT_RESULTS) ); if(len > 0) { // HERE: sBuf.resize(le...

How to obtain all subsequence combinations of a String (in Java, or C++ etc)

Let's say I've a string "12345" I should obtain all subsequence combinations of this string such as: --> 1 2 3 4 5 --> 12 13 14 15 23 24 25 34 35 45 --> 123 124 125 234 235 345 --> 1234 1235 1245 1345 2345 --> 12345 Please note that I grouped them in different number of chars but not changed their order. I need a method/function does...

QDesktopServices::openUrl with Ressource

Hello, How do I open a ressource file (qressource) using the command QDesktopServices::openUrl ? I tried several ways, but none seemed to work (for instance QDesktopServices::openUrl(QUrl(tr(":ressource.pdf")));) Thank you. ...

Choosing between WPF, wxWidgets, Win32 API and MFC

Imagine you are on Windows 7 and you have to write a GUI for a GRAPHIC application, (like a terrain editor, mesh viewer ..) which involves a great use of DirectX and OpenGL (so written in native C++). If your goal is a multi-platform software then you should go for wxWidgets, but imagine you're doing a Windows' only app...what would your...

Case insensitive search in Unicode in C++ on Windows

I asked a similar question yesterday, but recognize that i need to rephase it in a different way. In short: In C++ on Windows, how do I do a case-insensitive search for a string (inside another string) when the strings are in unicode format (wide char, wchar_t), and I don't know the language of the strings. I just want to know whether t...

Out of memory (?) problem on Win32 (vs. Linux)

I have the following problem: A program run on a windows machine (32bit, 3.1Gb memory, both VC++2008 and mingw compiled code) fails with a bad_alloc exception thrown (after allocating around 1.2Gb; the exception is thrown when trying to allocate a vector of 9 million doubles, i.e. around 75Mb) with plenty of RAM still available (at lea...

Error: Compiling simple PjSIP program under ubuntu

Hello all, I am trying to compile simple PjSIP program under ubuntu. I am getting error as /usr/bin/ld: cannot find -lpjsua-i686-pc-linux-gnu Whats meaning of it ? Here is the ouput root@mypc-desktop:/home/mypc/pjsip# make gcc -o myapp myapp.cpp -DPJ_AUTOCONF=1 -O2 -I/home/mypc/pjproject-1.4.5/pjlib/include -I/home/mypc/pjproject...

C++ user-defined conversion operators without classes?

In C++ is it possible to define conversion operators which are not class members? I know how to do that for regular operators (such as +), but not for conversion operators. Here is my use case: I work with a C Library which hands me out a PA_Unichar *, where the library defines PA_Unichar to be a 16-bit int. It is actually a string code...

C++ as first language for Windows game programming?

I'm a hobbyist programmer with a fair grasp of Python and I'm currently learning C. Recently I was talking to a colleague who also wants to learn to program. In his case, he wants to learn C++ as a path to Windows game programming using DirectX. Personally, I feel diving straight into C++ as your first language is a bit much - it's hard ...

where should I put my test code for my class?

So I've written a class and I have the code to test it, but where should I put that code? I could make a static method Test() for the class, but that doesn't need to be there during production and clutters up the class declaration. A bit of searching told me to put the test code in a separate project, but what exactly would the format of...

How to support both IPv4 and IPv6 connections

Hello, I'm currently working on a UDP socket application and I need to build in support so that IPV4 and IPV6 connections can send packets to a server. I was hoping that someone could help me out and point me in the right direction; the majority of the documentation that I found was not complete. It'd also be helpful if you could poin...

Push Call to STL Queue<std::string> causes Segfault when String is read off socket

I'm using an STL Queue as an input queue, it's containing std::strings, which I have aliased as String using a typedef. I'm reading the input string off a socket - using Berkeley sockets. It is read into a char buffer array and then used to set a string which is passed to the queue. It only happens for the input queue - the output que...

Where can I set path to make.exe on Windows?

When I try run "make" from cmd-console on Windows, it runs Turbo Delphi's make.exe but I need MSYS's make.exe. There is no mention about Turbo Delphi in %path% variable, maybe I can change it to MSYS in registry? Please, help. ...

Can you give me examples of odd single line comments in C++?

I wrote a method to remove single line comments from a C++ source file: def stripRegularComments(text) { def builder = new StringBuilder() text.eachLine { def singleCommentPos = it.indexOf("//") def process = true if(singleCommentPos > -1) { def counter = 0 it.eachWithIndex { obj,i -> if((obj == '\'')...

Overload bracket access and assignment C++

I'm writing a hash table for my data structs class, and I'd like to add a little syntactic sugar to my implementation. template <typename HashedObj, typename Object> Object & Dictionary<HashedObj, Object>::operator[](HashedObj & key) { return items.lookup(key); } That works fine when I do something like cout << dict["mykey"]. But h...