|
Hi,
i am using a CTreeCtrl ,but when tree have so many items scrollbar is not working properly.
items at the end of tree not diplay and hash line also not visible properly please help me what can i do here?
thanks.
|
|
|
|
|
|
|
|
How does one write code to make drawings in the Windows main client area of a Win32 C++ app?
I found an example online that uses the "eclipse" API but when I put it in my program, the IDE complained so it would not compile.
|
|
|
|
|
You can use the Windows GDI functions like Rectangle , Ellipse , TextOut , LineTo , MoveTo etc. to draw in the window. Each of these functions take a device context (DC) as its first parameter. It is this device context that determines where the drawing appears. In your case use the GetDC function with the handle to the window to get the device context of the window where you want to draw.
|
|
|
|
|
You can use either of the GDI or GDI+[^] graphics functions, or any of the newer more advanced libraries. Getting familiar with GDI or GDI+ would be a good starting point.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
In a general win32 program you should handle the WM_PAINT (and maybe the WM_ERASEBKGND) message of the windows you want to paint. In WM_PAINT you might get a HDC handle to draw on (with GDI functions[^]). If you are not working with a framework that gives you a HDC to draw on then you have to call BeginPaint()[^] and EndPaint()[^] in your WM_PAINT handler and beginpaint gives you a HDC draw on before you call EndPaint().
Its important to draw you window from the WM_PAINT handler because the surface of your window might get lost any time (at least this was the case before 3D accelerated desktops) for example when someone brings a window in front of your window and then it switches back to your window. In this case windows might send a WM_PAINT to your window to redraw its surface and the thing you drew on it will disappear if you don't redraw it from the WM_PAINT. You can't assume that the thing you draw on a window remains there if you perform drawing from outside the WM_PAINT handler.
|
|
|
|
|
For simple drawings, go with GDI... it'll give you a basic understanding of how Windows draws things. Obviously, this isn't really suitable for complex graphics, but it's a great starting point for someone with no experience with graphics development.
|
|
|
|
|
Dear frnds im trying to create http client application in c/c++ which call webservice using only url of webservice and soap
but i dont know how to do it in c/c++
can any one help me
Thanks
Sangam
|
|
|
|
|
|
thanks for reply
i already visited to these links but not get satisfied answer
pls give some example that can become helpfull.
Thanks again
Sangam
|
|
|
|
|
Find a Windows Web Services API Example [here].
More examples [here].
An article about Windows Web Services [here].
|
|
|
|
|
A common/open source method of working with SOAP/web services from C/C++ is using the gSOAP library.
Here's the link:
http://www.cs.fsu.edu/~engelen/soap.html[^]
It really is relatively simple to work with, it may take a bit of a learning curve depending on your depth/breadth of knowledge in the area of C/C++ programming, sockets, web development (including services).
|
|
|
|
|
Hi Friends,
Any one can explain about MFC design pattern. Past 3 years Iam developing MFC application, but i never gone through such design pattern procedure. I have refered some of the articles, but i feel difficult to understand it. Can anybody help me....
1.what MFC design pattern?
2.why we need to go for MFC design pattern?
3.Any real time example there?
Thanks and Regards,
S.Shanmugaraja
|
|
|
|
|
There is no dificult to understand ... in fact, you have to write so such code that could easely reuse it ... I think that is design patterns ... you could search on wikipedia ... and like hint, search for singleton pattern ...
|
|
|
|
|
MFC is a set of classes used for Windows programming, not a design pattern.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Exactly, its a framework, but on the other hand I saw some books that mentioned the document-view "design pattern" and some other similar stuff about MFC.
|
|
|
|
|
It's a long time since I read anything about MFC, maybe it is offering more than when I worked with it.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Same sh.t with some new stuff like ribbon. I see it in action regularly in old progs. Unfortunately legacy stuff keeps this beast alive and more or less updated.
|
|
|
|
|
MFC is a deprecated framework. Don't invest time in learning it unless you have to maintain legacy systems written in it. MFC is not just a GUI library, its a set of classes for a lot of other problems too but ppl are using MFC mainly as a C++ gui framework. Unfortunately I can't recommend a really good C++ gui library for you but Qt is definately a much better solution because its much more object oriented than MFC and its crossplatform. MFCism is a religion coming from the previous century, avoid it if its possible.
EDIT: I see there are some downvoter MFC fans here, but they are afraid to show their names and opinions... :P
modified 31-Jul-12 15:50pm.
|
|
|
|
|
MFC is not a deprecated framework, agreed that there are sections of it that are and always have been useless (all the collection classes), but it is still worked on and still offer good bang for the money for classic and modern application designs, especially when working with C++.
(I did not vote you up or down).
Watched code never compiles.
|
|
|
|
|
The design of the gui part is deprecated, and would say that its only half C++. I'm talking about gui because thats part is the most widely used from MFC. Among the helper classes I think there is some useful stuff but don't use them anymore because of crossplatform development. You can say "it works" even about the worst library of the world, its never a good reasoning. Its cost is zero if I'm right if you bought visual studio, but buying even the most expensive gui library is usually only a fraction of the development of a software. Of course you can put together nice gui in MFC, but its more difficult than doing the same with a better system. Not to mention the maintaining of the code, especially if a lot of ppl are working on it, and not all of them are MFC experts. You might be very good at it for now, but imagine how many things you must be aware of to handle MFC well: Win32 dialog resources, subclassing/hooking, window messages to some degree, etc... Its not a small piece... And its not just C++! A good gui library gives you a pure nice C++ interface.
EDIT: Its no problem to downvote something, the '1' button is there for this reason!
|
|
|
|
|
[This] article discusses what a Design Pattern is, classification of Patterns, and MFC and Design Patterns.
More on Design Patterns [here].
|
|
|
|
|
Hi,
I need to draw a spikey 3D surface plot. It might include 300 x 500 points along the horizontal x and y axes and the height (z-axis) might be an integer between 0 and 100. I want the hight to be represented by colour banding...i.e. a point at the front of the graph with a value of 100 would be a tall bar going from green through brown through orange through to white at the top. And a value of 50 would only be a bar with green through to brown.
The most simple (and hopefully effective) solution I can think of is to draw a vertical bar for each point, rather than any triangle drawing as Excel does for it's surface plot.
My question is...how can I do this quickly? I'd do some vector maths to skip any points that don't need to be drawn (hidden bars) and merge others that sit on the same pixel, but could still have 1-2000 points to draw! So would it be possible/quicker to use a cached bitmap of a single full height bar and just copy a portion of it (depending on the z-value) onto a memory dc 2000 times or to use GDI+ and draw 2000 gradient lines/bars? I've not used GDI+ so am trying to work out which bit of darkness to stumble into and read up on!
Any thoughts/suggestions/relevant articles would be hugely appreciated.
Thanks,
Phil.
|
|
|
|