I am trying to implement a template function with handles void differently using template specialization.
The following code gives me an "Explicit specialization in non-namespace scope" in gcc:
template <typename T>
static T safeGuiCall(boost::function<T ()> _f)
{
if (_f.empty())
throw GuiException("Function pointer empty");
{
Th...
I'm trying to export classes from a DLL that contain objects such as std::vectors and std::stings - the whole class is declared as dll export through:
class DLL_EXPORT FontManager
{
The problem is that for members of the complex types I get this warning:
warning C4251: 'FontManager::m__fonts' : class 'std::map<_Kty,_Ty>' needs...
I have an image format, and photoshop doesnt support it, and Ive been tasked with writting a plugin to import or open the format, but there seems to be little information out there and what information I can find is all about writting filter, but I want import/export/open not a filter!!!!
...
I have a file format I need to be able to show in explorer thumbnails. Since the target system is windows XP, the Vista PreviewHandler API will not be suitable. Ill be using c++.
How would I do it?
...
I'm being stupid here but I can't get the function signature for the predicate going to find_if when iterating over a string:
bool func( char );
std::string str;
std::find_if( str.begin(), str.end(), func ) )
In this instance google has not been my friend :( Is anyone here?
...
Hey everyone,
I have a set of 6 bits that represent a 7bit ASCII character. How can I get the correct 7bit ASCII code out of the 6 bits I have? Just append a zero and do an bitwise OR?
Thanks for your help.
Lennart
...
I have this design. I could not achieve what I need:
B is inherited from A.
A is inherited from QThread.
My goal is restart(re-run) to "worker" thread when it has finished its task. I intend to call the worker thread destructor for this approach because, it takes memory from heap. I need to clean-up all the related variables.
How c...
I am considering using COM interfaces within an embedded (non-Windows) system that has a limited C++ compiler, and I am looking for an open-source COM implementation using simple C++, in particular with little or no use of templates and without use of exceptions (yes I know COM doesn't use exceptions but an implementation could use them ...
I’m aware of the tutorial at boost.org addressing this
Boost.org Signals Tutorial, but the examples are not complete and somewhat over simplified. I’m a C# programmer that got put on a C++ project so my C++ is a little rough. The examples there don’t show the include files and some sections of the code are a little vague for me.
Here is...
Using Visual Studio 2008, I created a c++ Win32 project. To release the program, I made a visual studio setup project within the same solution. The setup.exe prompts my users to install .Net 3.5 SP1, which is often a 15+ minute install and only allowed to administrator level accounts. If they do not there is an error along the lines o...
This is similar to (but different from) this question.
Here is some simple test code to illustrate some weridness I have discovered with Sun CC:
//---------------main.cpp
#include "wtc.hpp"
int main(int, char**)
{
testy t;
t.lame(99);
return 0;
}
//--------------wtc.hpp
#ifndef WTC_HPP_INCLUDED
#define WTC_HPP_INCLUDED
class te...
I have written a DLL which exports a function that creates a window using RegisterClassExW and CreateWindowExW. Every message is retrieved via
GetMessageW(&msg, wnd_handle, 0, 0);
TranslateMessage(&msg);
DispatchMessageW(&msg);
Also there is a program which loads the DLL and calls the function.
Despite the Unicode window creation m...
I'm trying to connect the output of popen, a file pointer, to the input of TinyXML.
According to the main page, the best way to do it is using the parse method:
C style input:
* based on FILE*
* the Parse() and LoadFile() methods
I believe I need to use the TIXML_USE_STL to get to this. How do I go about finding examples and...
Using: VS2008, Win32, C/C++
I'm trying to encapsulate my entire dialog window into a class for reusability. Sort of like a custom control. In doing this, I am moving my seperate functions into a class. The following struct design though is giving me problems, with Visual Studio outputting: error C2334 '{'.
It's a simple message map ...
Is there a way to use stl algorithms like find() and find_if() in a container of objects?
Ex.:With find() find the element whit name "abc" in a vector of class Alfhabetic.
...
I am unable to decide which STL container to use in the following case:
(1). I want to preserve the order of insertion of the elements
(2). The elements in the container have to be unique.
Is there any readymade container available for this? I don't want to use a vector and then perform a std::find before doing a push_back every time...
I'm trying to debug a program using gdb mode in emacs. It was compiled with g++, and I'm using cygwin. My program takes one command line argument, and also takes input from stdin, which I redirect from a file, like this:
program.exe inputFile.dat <otherInput.dat
The problem is, gdb is sending the string
"<otherInput.dat"
as a comma...
We would like to hook calls to LoadLibrary in order to download assemblies that are not found. We have a handler for ResolveAssembly that handles the managed assemblies, but we also need to handle unmanaged assemblies.
We have attempted to hook LoadLibrary calls by re-writing the imports table via techniques specified in "Programming ...
I have code that looks essentially like this:
std::map<int, int> map1, map2;
BOOST_FOREACH(int i, map1)
{
// do steps 1-5 here...
}
BOOST_FOREACH(int i, map2)
{
// do steps 1-5 (identical to above) here...
}
Is there any way to concatenate the maps to eliminate the duplicate code in the second loop? Or a way to extend BOOST_FO...
I'm in the process of porting a large C++ application from Linux (gcc) to Windows (Visual C++ 2008) and am having linker issues with plugins. On Linux this wasn't an issue, as .so supports runtime symbol lookup, but dll does not seem to support this.
Some background information:
The application (the host), which hosts a scripting enviro...