Hello,
I have the fallowing statement:
vsnprintf(target, size - 1, "%ls_%ls", str16_1, str16_2);
Do you know why this fails on gcc?
I used this on Windows like this:
vsnprintf(target, size - 1, "%S_%S", str16_1, str16_2);
and it's working as expected. On gcc documentation I found that %S is synonym with %ls, but I must not use it...
the following code says
error: expected ‘;’ before ‘forwit’
error: expected ‘;’ before ‘revit’
template<class T>
class mapping {
public:
map<T,int> forw;
map<int,T> rev;
int curr;
//typeof(forw)::iterator temp;
map<T,int>::iterator forwit;
map<int,T>::iterator revit;
};
// }; // JVC: This was present, bu...
I have a program in native C++ under windows that uses a VB6 DLL. The C++ app crashes with a "Floating Point In-exact Result" error when using that DLL, for a certain action.
When I go into debug and do view assembler I get this line:
75A0FB7C je 759E8797
When you hover over the right most address it shows a tooltip with ...
Hey all, my names joe and im running into a few issues with the modulus in c++
heres the problem:
#include <iostream>
#include <string>
using namespace std;
int main()
{
//In short, this is what i am trying to do:
//divide two numbers, and get both the quotient
//and the remainder
//however, as an example, this below produces a remai...
Many functions in the latest release of OpenCV require the use of STL containers. I run into problems when trying to use them in a Matlab MEX file. I am compiling the MEX files from within Matlab. Both OpenCV and Matlab use the "/MD" flag which is "Multithreaded DLL" for code generation.
Compiler: MSVC++ 9.0
Matlab 2010a
OpenCV latest f...
Prior to today I had always believed that the order that objects and libraries were passed to g++ during the linking stage was unimportant. Then, today, I tried to link from c++ code to c code. I wrapped all the C headers in an extern "C" block but the linker still had difficulties finding symbols which I knew were in the C object archiv...
Hi,
is it possible to use OLE DB in MFC C++ to execute universal query?
I want to create function, one of parameters is sql query and I want to return something like two dimensional array with rows and columns returned by query.
The problem is, I don't know the structure of the query (of returned data), so I can't use CAccessor.
Thanks...
I am writing a c++ program which sooner or later will need to be updated. I want this to require as little interaction with the user as possible since the program runs constantly in the background and never terminates. I know that under normal circumstances, you can't write to a file that's being executed, so this is my question: is it p...
What is the different between these two?
cpp-file:
namespace
{
int var;
}
or
int var;
if both are put in the cpp file? Is not correct that we put a variable in anonymous namespace so it can be private for just that file? But if we put a global variable in a cpp file is not that variable also privat because you never do an incl...
Lets say I have a Base class as Parent and I want to know how many classes are derived from this class at runtime and create objects of all those classes along with calling the pure virtual function I declared in my Parent class.
How to do this in c++
...
I wanted to know if it is possible to write and debug a C++ application for Linux in Windows using Eclipse? If so could you point me in the right direction for configuring Eclipse?
Thanks
...
I am unsure about how function calls are translated and I am afraid that passed variables are copied into local variables when they don't need to be. I could avoid unnecessary copying by using global variables, but that cannot be a good solution...
1) When variables are not changed in the target function, would it be better to pass them...
i have following code
#include <iostream>
using namespace std;
int main(){
int i;
char *p="this is a string";
i=reinterpret_cast<int>(p);
cout<<i<<"\n":
return 0;
}
output is:
7648
please explain reinterpret_cast
...
Hi
I'm working on some old ATL OCX, that is used as "download manager".
It downloads files using URLDownloadToFile API.
Previously, it was hosted as ActiveX on web page so in case the server required authentication it was done by IE. Now it is part of executable, so it should take care of authentication.
Let say user provided username...
I have a couple of isolated applications that I am writing that all rely on dlls that are also written by myself and team. Things were fine when we only had a few dlls but not the build output directory is getting rather cluttered and hard to navigate. I would ultimately like to have the output build directory contain the following str...
I'm trying to use RAII concepts with an STL container of ofstream objects. For example:
int main(int argc, char**argv)
{
std::deque<std::ofstream> sList;
sList.push_back(std::ofstream()); // tried variations such as *(new ofstream())
sList[0].open("test1.txt");
sList[0] << "This is a test";
sList[0].close();
}
However, no ...
Hi everybody,
after one day of trying to figure out how to implement a kd-tree in OpenGL/GLSL i am pretty frustrated ...
I declare my KD-Nodes like this in GLSL:
layout(std140) uniform node{
ivec4 splitPoint;
int dataPtr;
} nodes[1024];
SplitPoint holds the kd-tree splitpoint, the fourth element of the vector holds the splitDire...
Hi,
I have an object Line which contains 2 objects of type Point called Point1 and Point2. I want to create a HashMap containing lines and whose keys are std::pair<Point1, Point2>.
What I'd like to do is find all the Lines with are referenced (for instance) by Point1, i.e. with key std::pair<Point1, Anything>. I don't care about std::...
I'm making a vector drawing application with OpenGL. Is there a way to implement a clipping mask? Ex: if I have Circle A and Circle B, I only want to see the part of circle B which intersects into Circle A's space. Is there a way to do this that isn't very expensif, I do not want to kill my application. Thanks
...
I can find what directory the process is running in using GetCurrentDirectory(), but what about finding the directory the EXE resides in?
...