|
sounds like fun
i'd do it by setting a minimum width for the bars, so it would typically show view_width / bar_min_width bars.
each bar shown will then represent a window of total_points / displayed_bars data points.
the height of each bar could be an average of the points in the window it represents, or the min, or the max. or, for sheer performance, just use the first sample from each window.
and if your input data is floating point, to speed the bar height calculations, you could generate an integer array that pre-scales the data points values into the 0..max_bar_height range.
|
|
|
|
|
Thanks Chris, very useful thoughts.
|
|
|
|
|
why the function strstr used in C ?
|
|
|
|
|
If you spend some time with the documentation[^] you will learn many useful features.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
why? Simply to search for a string in another string.
Watched code never compiles.
|
|
|
|
|
strstr() finds a substring in a string. use it to search inside string elements.
#include <stdio.h>
#include <string.h>
main()
{
char mainString[]="string to search";
char strstr_sub_string_to_search[]="to";
if ( strstr(mainString, strstr_sub_string_to_search)) puts("strstr() found Substring in main string\n");
else puts("strstr() did not find Substring in main string\n");
return 0;
}
|
|
|
|
|
|
I want to get the range of a line cursor in.
VBA code (word2010) looks like this:
================================================
ActiveDocument.Bookmarks.Item("\LINE").Range
C++ code looks like this:
================================================
CBookmarks oBookMarks = oDoc.get_Bookmarks();
VARIANT varName;
varName.vt = VT_BYREF|VT_I1;
char buff[6] = {"\\LINE"};
varName.pcVal = buff;
CBookmark0 oBookMark = oBookMarks.Item(&varName);
VBA code works perfectly but C++ code triggers some exception(required members does not exist).
Anyone knows why? I really appriciate for your help.
|
|
|
|
|
You are passing a string using the VARIANT pcVal member. Strings are usually passed using the bstrVal member with type VT_BSTR . When using MFC, you may use the COleVariant type which creates a VT_BSTR when passing a string:
CBookmark0 oBookMark = oBookMarks.Item(COleVariant(_T("\\LINE")));
Another error may be the name of the used function oBookmarks.Item() . Please check if this functions exists. If you have imported a typelib, see the generated header file. With C++ OLE automation, many item access function are named GetItem() and SetItem() .
|
|
|
|
|
thanks very much. the problem is solved. The reason is that I used the wrong VARIANT type.(I am puzzled on using VARIANT)
|
|
|
|
|
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
|
|
|
|