c++

Using C# how to clean up MSMQ message format to work with C++ IXMLDOMDocument2

I'm trying to get a C++ service to load an XML document from a MSMQ message generated by C#. I can't really change the C++ side of things because I'm trying to inject test messages into the queue. The C++ service is using the following to load the XML. CComPtr<IXMLDOMDocument2> spDOM; CComPtr<IXMLDOMNode> spNode; CComBSTR bstrVal; ...

C++ STL data structure alignment, algorithm vectorization.

Hello Is there a way to enforce STL container alignment to specific byte, using attribute((aligned))perhaps? the target compilers are not Microsoft Visual C++. What libraries, if any, provide specialized templates of STL algorithms which have specific explicit vectorization, e.g. SSE. My compilers of interest are g++, Intel, and IBM X...

Good beginners tutorial on CUDA?

I am looking for some good beginners tutorial for learning the basics of CUDA. ...

C++: Continue execution after SIGINT

Okay, I am writing a program that is doing some pretty heavy analysis and I would like to be able to stop it quickly. I added signal(SIGINT, terminate); to the beginning of main and defined terminate like: void terminate(int param){ cout << endl << endl << "Exit [N]ow, or [A]fter this url?" << endl; std::string answer; cin >> ...

OpenCV's IplImage* as function parametr error

Hello. I am using OpenCV library and I want to clone picture in separate function, but I cannot send address to the function IplImage* image = cvLoadImage( path, CV_LOAD_IMAGE_GRAYSCALE ); // loading is ok showFoundPoints(image); // -> here it shows errors ... //my function int showFoundPoints(IplImage*image) {...} And I got t...

What library is best for mysql-C++ programming?

What library is best for mysql-C++ programming? ...

Tips for writing a DBMS

Hi, I have taken a graduate level course which is just one big project - to write a DBMS. The objective is not to reinvent the wheel and make an enterprise DBMS to rival Oracle. Only a small subset of SQL commands need to be supported. Nor is the objective to create some fancy hybrid model DBMS for storing multimedia or something. It ha...

How to use boost::array with unknown size as object variable

I'd like to use boost::array as a class member, but I do not know the size at compile time. I thought of something like this, but it doesn't work: int main() { boost::array<int, 4> array = {{1,2,3,4}}; MyClass obj(array); } class MyClass { private: boost::array<int, std::size_t> array; public: template<s...

Compilable C++ code to implement a secure SLL/TLS client using MS SSPI

As described here http://www.ddj.com/cpp/184401688 I do not have time to write this from scratch. Asked and not answered http://stackoverflow.com/questions/434961/implementing-ssl THE QUESTION IS: I am looking for some compilable working source code that implements MS SSPI (as alluded to in the thread above), procedural not OOP prefe...

Connection and event Sink implementation of Browser(ie, mozilla and google chrome)

how to implement event sink to enable the developed application to listen to event made by this three browsers: Internet explorer, mozilla firefox and google chrome? the application is a stand-alone application running in a network.. thanks!^^ ...

C++ virtual function execution efficiency

hello I am trying to get a better idea of performance of virtual functions here is an example code: struct Foo { virtual void function1(); virtual void function2() { function1(); } }; struct Bar : Foo { virtual void function1(); } Bar b; Foo b.function2(); b.function1(); f.function2(); for each of three calls in the...

what's polymorphic type in C++?

I found in one article saying "static_cast is used for non-polymorphic type casting and dynamic_cast is used for polymorphic type casting". I understand that int and double are not polymorphic types. However, I also found that static_cast can be used between base class and derived class. What does polymorphic type here mean? Some peopl...

Python ctypes callback function to SWIG

I have a SWIG C++ function that expects a function pointer (WNDPROC), and want to give it a Python function that has been wrapped by ctypes.WINFUNCTYPE. It seems to me that this should be compatible, but SWIG's type checking throws an exception because it doesn't know that the ctypes.WINFUNCTYPE type is acctually a WNDPROC. What can I ...

Why is Application Binary Interface important for programming

I don't understand why the ABI is important context of developing user-space applications. Is the set of system calls for an operating system considered an ABI? But if so then aren't all the complexities regarding system calls encapsulated within standard libraries? So then is ABI compatibility only relevant for running statically link...

Firefox basic modification

Hello friends, I have to modify firefox to make it an automated client for testing some personal servers. I have to:1.Have firefox connect normaly, send the GET HTTP, and run all scripts on that web page. 2.Firefox does not display the page but save it to a file. I have not yet red the documentation, or the source, sorry. I want some hin...

Can you call a copy constructor from another method?

/** @file ListP.cpp * ADT list - Pointer-based implementation. */ #include <iostream> #include <cstddef> // for NULL #include <new> // for bad_alloc #include "ListP.h" // header file using namespace std; List::List() : size(0), head(NULL) { } // end default constructor List::List(const List& aList) : size(aList.size) { if (aLi...

C++ cin.fail() question

When running the following code and enter a number, it works fine. But when entering a letter, the program enters an infinite loop, displaying "Enter a number (0 to exit): cin failed." My intent was to handle the cin fail case and prompt the user again. int number; do{ cout << "Enter a number (0 to exit): "; cin >> number; ...

Creating a new object from dynamic type info

In C++, is there any way to query the type of an object and then use that information to dynamically create a new object of the same type? For example, say I have a simple 3 class hierarchy: class Base class Foo : public Base class Bar : public Base Now suppose I give you an object cast as type Base -- which is in reality of type Foo...

Why COM (Component Object Model) is language independent ?

I know that COM provides resuability at binary level across languages and applications. I came to know that all components build based on COM have standard memory layout inorder to be language indepedent. I am not getting what is the meaning of "standard memory layout"? And What makes it language independent ? Any input is welcomed......

Passing a string literal as a parameter to a C++ template class

I want a class which takes two parameters in its constructor. The first can be either an int, double or float, so , and the second is always a string literal "my string", so I guess const char * const. Can anyone give me some compilable code which declares a simple class template as described and declares an object of that class? Than...