c++

SetWindowsHookEx - Dll Injection misses out on the first few calls

Hi, I am trying to use SetWindowsHookEx to capture calls to a API in java.dll. So I created another dll, and injected into all other processes using setwindowsHookEx g_hHook = SetWindowsHookEx(WH_CALLWNDPROC, JLoadSetFunc, g_hHookDll, 0) The problem is following: While trying to capture calls from a process, I notice that my dll ge...

Using python regex to extract namespaces from C++ sources

Hi, I am trying to extract the namespaces defined in C++ files. Basically, if my C++ file contains: namespace n1 { ... namespace n2 { ... } // end namespace n2 ... namespace n3 { ...} //end namespace n3 ... } //end namespace n1 I want to be able to retrieve: n1, n1::n2, n1::n3. Does someone have any suggestion of how I ...

How to compile the Botan crypto library as a static lib in VC++?

I've been extremely unsuccessful in compiling Botan as a static library in Visual C++. The build.h file contains the following code: #ifndef BOTAN_DLL #define BOTAN_DLL __declspec(dllexport) #endif This macro then shows up pretty much everywhere in the Botan codebase, like this: class BOTAN_DLL AutoSeeded_RNG : public RandomNumberG...

bus error/segmentation fault for std::vector<int> declaration

Hello! I have the following data structure declaration on which I make the following operation: //QSweep.cpp void QSweep:: createLoops(){ std:: vector< int > orientationUE; if (test1) orientationUE.push_back(1); else orientationUE.push_back(-1); Everythink works fine so far. The problem is that I have several files an...

boost::bind and class member function

Hello! Consider following example. #include <iostream> #include <algorithm> #include <vector> #include <boost/bind.hpp> void func(int e, int x) { std::cerr << "x is " << x << std::endl; std::cerr << "e is " << e << std::endl; } struct foo { std::vector<int> v; void calc(int x) { std::for_each(v.begin(), v.en...

Arrays of strings in Managed C++

I'm trying to write an application in Managed C++, but I cannot work out how to declare an array of strings. String^ linet[]; throws an error 'System::String ^' : a native array cannot contain this managed type So I suppose there's a different way to do this for managed data types. What exactly is it? ...

getaddrinfo returns always 11001 (host not found)

Although the searched FQDN appears in etc\hosts file. Any idea? Thanks a lot! ...

C++ template syntax

I don't understand what is wrong with this code. gcc reports "Client.h:29: error: expected template-name before '<' token" As far as I'm aware I'm followed the template syntax correctly, but it could be that the error message is confusing me and is not the problem client.h class Client : public BaseDll<DllClient> [line 29] { ..snip.....

Unable to find the location of C++'s standard libraries in OS/X?

I have looked at /System/Library, but I have not found the iostream library/module by ack iostream Where are the standard libraries in OS/X? ...

How are Java generics different from C++ templates? Why can't I use int as a parameter?

I am trying to create ArrayList<int> = new ArrayList<int>(); in Java but that does not work. Can someone explain why int as type parameter does not work? Using Integer class for int primitive works, but can someone explain why int is not accepted? Java version 1.6 ...

Is there a right way to return a new object instance by reference in C++?

So I was writing some code, and I had something like this: class Box { private: float x, y, w, h; public: //... Rectangle & GetRect( void ) const { return Rectangle( x, y, w, h ); } }; Then later in some code: Rectangle rect = theBox.GetRect(); Which worked in my debug build, but in release ther...

How to find a memory leak in C++

Hello Stack overflow, What would be a good way to detect a C++ memory leak in an embedded environment? I tried overloading the new operator to log every data allocation, but I must have done something wrong, that approach isn't working. Has anyone else run into a similar situation? This is the code for the new and delete operator overl...

Building a Mobile Device: Possible to use XHTML/CSS/JS?

Hey all, I'm building a general mobile device that will operate on Ubuntu x86. Is it at all possible, and decently scored in performance, to build said system from HTML/CSS/Javascript? I'm currently a frontend and backend web developer and designer. At this point, I'm writing the device in C++, but was thinking about converting it into...

C++ shift operator precedence weirdness

Consider the following code: typedef vector<int> intVec; intVec& operator<<(intVec& dst, const int i) { dst.push_back(i); return dst; } int intResult0() { return 23; } int intResult1() { return 42; } // main intVec v; v << intResult0() << intResult1(); The weird thing is, that the compiler generates code, which evalu...

Loading Mesh from X File with Direct X 9 in C++

Hi, I have been having problems on making a Load Mesh function in C++ for Direct X. I seem to get this error: "Unhandled exception at 0x00401e64 in _.exe: 0xC00000005: Access violation reading loaction 0x83e05597". I know it is crashing on this line: D3DXMATERIAL* tempMaterials = (D3DXMATERIAL*)bufMaterial->GetBufferPointer(); The ...

JNI Call to Authenticate user using LogonUser?

Hey Folks, C++ noob here wonding how i can authenticate a Windows User via Java servlet. Here is the code i have put together to take in a JNI call from my java servlet with the user's username domain and password: #include <stdio.h> #include <string.h> #include <sys/stat.h> #include <stdlib.h> #include "Validate.h" JNIEXPORT j...

How to make configure script check the dependencies

Hi I generated a configure script with autoconf to build my project. It works fine unless I don't have some needed library installed. Make returns error when lacking some files, but it should be actually checked by the configure script i think? So my question is: How to modify an autoconf generated script to seek for dependencies and ...

CRC error-correction library?

Is there a CRC library that enables the user not only detect errors but also correct them? I'm looking for a C/C++ or Java library, ideally open-source. ...

Property Pages (Wizard) - OnQueryCancel

I am trying to handle the 'Cancel' button in my property pages (wizard) and I've implemented the 'OnQueryCancel' function to catch the cancel message successfully, but unfortunately it seems that the 'OnQueryCancel' function is being called twice if the user clicked the cancel button. Any ideas on how I could address this issue? Thanks! ...

Directly accessing the modem in Windows Mobile

For some reasons I need to be able to access the internal modem of a Windows Mobile smartphone (a HTC s740 with WM version 6.1). What I want is to be able to access it like it was a serial port in order to give AT-commands. I have code that uses the TAPI Line interface and lineGetID() to get a "handle" on which I shuld be able to do Rea...