c++

Choosing a cryptography library

Duplicate of this and this. I'm looking for a free C or C++ cryptography library that can be embedded in a closed-source applicationand supports RSA public-key cyphering. I've found OpenSSL and Crypto++ but neither have a good documentation for a beginner. Anyone knows a good, free, C or C++ cryptography library with a decent docu...

What kind of DLL should I use (or .lib, or class)

So I am new to .net and c++ and am in need of a "library" of functions that can be called and also events that are raised in the main application that is using the library. I have a C++ library (.lib) that I want to add another layer (wrapper) on top of it and only expose a few functions and events for the main application. I don't kno...

select() call not returning when chars on port

I have a select call that doesn't seem to detect characters on the serial port. Is there anything I am missing? If I remove the read() code that is in the block above the select will return for a while until the existing port buffer is emptied and then nothing more is detected. I am streaming characters to the port, and running mini...

documentation for STL

I have spent the last several years fighting tooth and nail to avoid working with C++ so I'm probably one of a very small number of people who likes systems programming and template meta programming but has absolutely no experience when it comes to the STL and very little C++ template experience. Does anyone know of a good document for...

boost microsec_time_clock.hpp warning C4244

Hi. I'm new in using boost and have a problem. I need shared_mutex function in my project. So I've done #include "boost/thread/shared_mutex.hpp" And compiled my project. My MSVC 2005 with "treat warnings as errors" stops compilation because of a warning: c:\\...\microsec_time_clock.hpp(103) : warning C4244: 'argument' : conversion f...

Memory allocation and deallocation across dll boundaries

I understand that memory allocations made in one dll then subsequently free'd in another can cause all sort of problems, especially regarding the CRT. These sorts of problems are especially problematic when it comes to exporting STL containers. We've experienced these sorts of problems before (when writing custom Adobe plugins that lin...

Calling unexported functions in Win32 C++

How would I go about calling an unexported function in Win32 C++? ...

How can I create an executable to run on a certain processor architecture (instead of certain OS)?

So I take my C++ program in Visual studio, compile, and it'll spit out a nice little EXE file. But EXEs will only run on windows, and I hear a lot about how C/C++ compiles into assembly language, which is runs directly on a processor. The EXE runs with the help of windows, or I could have a program that makes an executable that runs on a...

why a variable declared but not used may cause a error?

If i declare a variable but not use it later in the program, the complier will give me a warning, and since "every warning should not be ignored", why the warning is there? and how can it cause a error? thanks! ...

Clearest way to code structarray map functor in C++

This is a poll for opinions on the most readable way to do something -- whether to use a C++ pointer-to-member, a byte offset, or a templatized functor to define "select member X from structure foo". I've got a type that contains a large vector of structures, and I'm writing a utility function that basically operates as a reduce over s...

C++ class design problem

I have a class that executes the MSNP15 protocol. The protocol requires clients to perform frequent connection/disconnection to various servers like the dispatch server, login server and the switchboard server. I decided to store the protocol related variables ( like ticket tokens, nonce etc ) as static member variables in a utility cl...

how to declare a function which is member of a class and returns a function pointer to a thread?

Hi All, I want to write a function(say foo) which takes string as an argument and returns a function pointer ,however this pointer points to following function: DWORD WINAPI fThread1(LPVOID lparam) Also the function(foo) is member of a class so i will be defining it and declaring it in seperate files(header and .cpp files). Please h...

How to Draw Two Detached Rectangles in DirectX using the D3DPT_TRIANGLESTRIP Primitive Type

I am new to DirectX and I am trying to draw two rectangles in one scene using D3DPT_TRIANGLESTRIP. One Rectangle is no problem but two Rectangles is a whole different ball game. Yes i could draw them using four triangles drawn with the D3DPT_TRIANGLELIST primitive type. My curiosity is on the technic involved using D3DPT_TRIANGLESTRIP. P...

Do you know a good freeware that creates C++ or C# classes (data model) from XSD?

I know examples but there are not free tools. Need one that is free and reliable. Thanks! ...

Equivalent code in managed C++ & C# (Events in VB6)

In VB6 events created in an ActiveX component were stated like this: Public Event ProcessingComplete() and called in that ActiveX component like: RaiseEvent ProcessingComplete I am creating a managed C++ DLL that I want to do the same thing with. It doesnt look like delegates are exactly what I want. I think the more appropriate it...

VTK Delete() and data deletion

Hi, I was browsing through the VTK 5.4.2 code, and can't seem to understand how does the Delete() function works. I mean, the Delete() function is in vtkObjectBase and is virtual, but, through what chain of commands is the destructor of the vtkDoubleArray class (for example) executed? best regards, mightydodol ...

Binding temporary to a lvalue reference

I have the following code string three() { return "three"; } void mutate(string& ref) { } int main() { mutate(three()); return 0; } You can see I am passing three() to mutate method. This code compiles well. My understanding is, temporaries can't be assigned to non-const references. If yes, how this program is compiling...

How to access Digital I/O using USB

Hi, How to access Digital I/O using USB using C or C++ or Vb.net Or C#.net? ...

How to detect the amount of stack space available to my program?

My Win32 C++ application acts as an RPC server - it has a set of functions for processing requests and RPC runtime creates a separate thread and invokes one of my functions in that thread. In my function I have an std::auto_ptr which is used to control a heap-allocated char[] array of size known at compile time. It accidentially works w...

How to use dll's?

I know that if I have an .a or .so file and a header file for that library (for example for SystemC), I should 1. include header file 2. link the appropriate library. But I can't handle with only .dll file as I can link it as well, but don't have a hearer file to include and to use commands. Con someone explain me what kind of .dll-s...