Sometimes our application needs to draw very long strings (e.g. 6,000 chars) using ExtTextOut. Sometimes ExtTextOut fails and returns zero and GetLastError returns zero as well.
To re-create the situation create a simple MFC Single Document application and then set the OnDraw to be:
void CTestExtTextView::OnDraw(CDC* pDC)
{
CTestExtTe...
In class A, there is a vector V.
V is a private member.
In class B, I want to print all items of V.
What is the best way to do this?
It is very easy to get an iterator of a vector in the same class, but not easy in another class.
Thank you for reading.
...
Possible Duplicate:
what is the difference between #include <filename> and #include filename
Is there a fundamental difference between the two #include syntax, apart from the way the path the compiler will search for?
I have the feeling that Intel's compiler does not give exactly the same output.
...
I've been working with somebody else's code and noticed that on all uses of ostringsteam they are in the habit of explicitly appending std::ends.
This is something I've never done and have never encountered a problem.
It doesn't appear to, but should std::ends make any difference in the following code?
ostringstream message;
message <...
I am aware that map is not prepared to be sorted, its heavily optimized for fast and random key access., and actually doesn't support std::sort.
My current problem is that I have a full
map<std::string,int>
which I'm not going to use anymore, I just need to extract 10 pairs in value(int) order and destroy it.
The best thing if it ...
I'm trying to port a
int a[][]
from Java to C++. I'm using this class as a container ArrayRef for ints because it handles references, and the project uses it extensively. In the AbstractReader class I declared
const ArrayRef<int> START_END_PATTERN_;
const ArrayRef<int> MIDDLE_PATTERN_;
const ArrayRef<ArrayRef<int> > L_PATTERNS_;
co...
I have a CDHTMLDialog running in IE that has a fixed size that I chose, and runs in a fixed window to match this size.
My problem is that the user can zoom on it (by ctrl-mousewheel) causing my html to be larger or smaller than the window which looks awkward and adds annoying scrollbars. Also, the user might use ctrl-+ or ctrl-- to cha...
I have a C++ application that uses a third-party library. Every here and there in my code there're calls to that library. I would like to trace all such calls.
It would be easy if those were functions in my code - I would insert a macro that would obtain the current function name and time of call start and pass those to a local object c...
The problem:
I have a C++ class with gajillion (>100) members that behave nearly identically:
same type
in a function, each member has the same exact code done to it as other members, e.g. assignment from a map in a constructor where map key is same as member key
This identicality of behavior is repeated across many-many functions (>2...
I have a CDHTMLDialog in a BHO that I want to be partially transparent, in the sense that the transparent area changes according to the logic of the dialog. I got it to become transparent visually (using SetLayeredWindowAttributes), but it is critical to make this region truly transparent, because otherwise when I click on the transparen...
I'm an experienced Java/C# developer. I studied C/C++ in university but have never used them to build any non-trivial software. Now I'm interested in learning about C/C++ programming in Windows and looking for good books to get started.
Specifically, I want to learn about Win32 API, MFC, COM, event hook, screen capturing, multithrea...
Hi, I have built and compiled a command line program with GNU g++ which "overflows" the stack for a number of reasons, mainly deep inheritance, lots of objects created, etc. So I followed this workaround on Mac OS X to solve the problem when linking:
-Wl,-stack_size,0x10000000,-stack_addr,0xc0000000
Under Linux, I just tried ulimit -s...
I have a code that generates errors on my PC but does't on other PC.I have windows 7 installed and also installed the compatible SDK for windows 7.I have also included the VC directories (from Tools -> option-> vc Diretories) but still the code generates follwing errors.
error C2059: syntax error : 'constant'
error C2238: unexpected to...
How do you tell the compiler to unroll loops based on the number of iterations or some other attribute? Or, how do you turn on loop unrolling optimization in Visual Studio 2005?
EDIT: E.g.
//Code Snippet 1
vector<int> b;
for(int i=0;i<3;++i) b.push_back(i);
As opposed to
//Code Snippet 2
vector<int> b;
b.push_back(0)...
I recently started looking into Qt (I installed Qt 4.5.2 and installed their Eclipse-CDT plugin called "qt integration v1.5.2" and I will do all my development in Linux-Eclipse-CDT-QTintegration).
Originally I thought Qt was a straight vanilla C++ library but when I installed and started running Qt example code I saw lots of "weird" thi...
I just started using QT and noticed that in each example code folder there is a *.pro file (and there is also a makefile created too... why?). What is the purpose of the *.pro file?
...
I just started using Qt and noticed that it uses it's own make tool, qmake. Why does Qt use its own make tool?
Is there something special that prevents it from using a standard make tool?
Does qmake call the GCC C++ compiler?
...
I just started using Qt and I wanted to debug my Qt application. Can I use the standard GDB debugger with Qt executables?
...
I just started using QT and noticed that all the example class definitions have the macro Q_OBJECT as the first line. What is the purpose of this preprocessor macro?
...
How do signals and slots work at a high level abstraction?
How are signals and slots implemented at a high level abstraction?
...