|
Actually you just need to keep the data in CString? Then use GetBuffer, and copy the data using CopyMemory. But remember, you should not perform any string operations because it is having null characters...
- NS -
|
|
|
|
|
The CString class is designed to handle C-style strings, meaning strings that are terminated with a character value of zero (AKA NUL ). It is not designed to handle raw data that contains embedded NUL characters, not double-NUL -terminated collections of strings.
Sounds like you may be a bit too comfortable with CString s...
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
i want to lern to draw a dynamic curve,but do not know how to do;
is there any good Activecontrol or methode,
my idea is, continuesly get data from a database or by some way else, then draw them on a picture, the curve should be dynamic.
thanks a lot
wuhuaiji
|
|
|
|
|
What is your problem?
In OnDraw() , you draw the curve (MoveTo() , LineTo() ) into the client rect . Whenever you get new data and fell the need to redraw, you Invalidate() .
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
hello
thanks for your answer
my problem is, how to make the curve move smoothly? it move from right to left with time going
wuhuaiji
|
|
|
|
|
Do you want algorithms to interpolate and smooth the curve-data?
Or do you want to reduce flicker on the screen?
Either case, there are articles here on codeproject and on the net.
E.G. here[^].
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
have you googled to for "Active X Control to draw a curve"
there are somany articles and active X controls related to that topic.
or if you want to develop one active X control, then i can guide you.
|
|
|
|
|
But why he must uses of Activexs control?
|
|
|
|
|
good question,
but as he said, he want to draw it on a picture.
so i thought, he would have to develop an AX to fulfil his task.
iam not sure, weather any existing control, has a mixture of both image and a graph on it.
|
|
|
|
|
Why are you so obsessed with ActiveX controls . Why not simply use a custom control ?
Do you know why ActiveX are used ? Do you know that the purpose of ActiveX is to have a control that can be used in different languages. If you just developping a C++ app, why bothering with an ActiveX when you can simply use a custom control.
|
|
|
|
|
yes you are right.
But i feel comfortable with AX because most of the times I use it in other languages also. Thats why i'm used to that.
Thank You.
|
|
|
|
|
Well, but for somebody that only wants to use a control in its C++ application, this is a bad advice to tell him to develop its own ActiveX control. Why do you want to make things even more complex to him ? Developping an ActiveX control is more complicated than developping a simple custom control.
|
|
|
|
|
yes and thanks,
i agree to your point.
|
|
|
|
|
thanks
i have googled, and now i know how to draw a static curve
but i want to draw a dynamic curve, which can move smoothly with time going
wuhuaiji
|
|
|
|
|
what is the difference you are referring to as static and dynamic curves.
you mean, you want to see the curve increasing from time to time, at run time?
if it is so, put your plotting code in a thread.
but i can suggest ful fledgedly, only, if u can provide a sample of code here, how you made it static.
gud luck.
|
|
|
|
|
|
Why you cant draw a curve with existing APIs? What kind of data and curve are you intended to use?
- NS -
|
|
|
|
|
thanks a lot
first, i am a newbie,
then, i just want draw a curve, which can move
now i have got many friends' help, thanks for all of your answer
and i think maybe i have found the solution
indeed, the question is a little problem, the big problem is that i am fresh in VC
wuhuaiji
|
|
|
|
|
You have two options:
1) Use an existing control, there are plenty existing on this website. I also developped one control that can do that (see the link in my sig). I think it is the easiest solution and the one that will save you a lot of troubles.
2) Create your own control. You seem to have some problems with the fact that the line should move. Well, there is no miracle: if you want to do such a thing, you have to make it move yourself (redraw the line completely).
I warn you that this is far from being the easiest solution. If you are completely new to this, I suggest you take the first option. But if you have some time and want to learn how it works, then it can be interesting to take that path. But then, start by reading some tutorials about how to create custom controls before starting to create your own.
|
|
|
|
|
Hi everybody,
i create my self a menu-object, so i can display the menu-items dynamically :
CMenu *Home = new CMenu();
Hom->AppendMenu(MF_STRING,ID_MYMENU_GO,"Go");
Home->TrackPopUpMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,point.x,point.y,Parent);
The ID_MYMENU_GO isn't known and the menu item is disabled.
If i create a new String-Ressource with the ID of ID_MYMENU_GO and set a String of "-"
the Menu-Element is displayed correctly ...
Is it also possible to set the Menu-Item ID to the project/mainform/.. so that
the application knows the ID ?
For example adding the String via programmation into the known ID's ...
Big thanks for help
|
|
|
|
|
|
just wanted to know if there is any readymade application where in progress bar is used. want some application where the progress bar should should tell me the progress while i am copying or playing a song.
|
|
|
|
|
|
Im not sure CSkinProgress[^] is answer to your question or no if its not more explain will be helpful.
|
|
|
|
|
Hello.
I have found a bug (in Windows maybe) while writting in Win32 API.
I have the following code executed:
OPENFILENAME OpenFileName={0};
TCHAR szFilter[]=__TEXT("Graphs (*.graph)\0*.graph\0All Files(*.*)\0*.*\0\0");<br />
TCHAR szFile[MAX_PATH];<br />
szFile[0] = __TEXT('\0');<br />
OpenFileName.lStructSize = sizeof(OPENFILENAME);<br />
OpenFileName.hwndOwner = hwnd;<br />
OpenFileName.hInstance = NULL;<br />
OpenFileName.lpstrFilter = szFilter;<br />
OpenFileName.lpstrCustomFilter = (LPTSTR) NULL;<br />
OpenFileName.nMaxCustFilter = 0L;<br />
OpenFileName.nFilterIndex = 1L;<br />
OpenFileName.lpstrFile = szFile;<br />
OpenFileName.nMaxFile = sizeof(szFile)-1;<br />
OpenFileName.lpstrFileTitle = NULL;<br />
OpenFileName.nMaxFileTitle = 0;<br />
OpenFileName.lpstrInitialDir = NULL;<br />
OpenFileName.lpstrTitle = NULL;<br />
OpenFileName.nFileOffset = 0;<br />
OpenFileName.nFileExtension = 0;<br />
OpenFileName.lpstrDefExt = TEXT("graph");
OpenFileName.lCustData = 0;<br />
OpenFileName.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_LONGNAMES;<br />
if (GetOpenFileName(&OpenFileName)){<br />
return (CString)OpenFileName.lpstrFile;<br />
}<br />
return (CString)"";
This, as I hope you know, creates the Windows OpenFile Dialog.
When the window appears do the following:
1. Go to the Desktop.
2. Place the cursor above a file (not a link to a file) and wait for the tooltip to appear. Then press Esc to exit. Then execute again the code and do the same thing (on the same file extension). At that point I get a crash in SHELL32.DLL. See the debug output below. I tried that in an other app and I got the same crash. However, same apps do not crash, so I wonder if I am doing sth wrong or if someone knows sth more about this.
Loaded 'C:\WINDOWS\system32\xpsp2res.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Ahead\Lib\NeroDigitalExt.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Ahead\Lib\MFC71.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Ahead\Lib\msvcr71.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Ahead\Lib\msvcp71.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Adobe\Acrobat\ActiveX\pdfshell.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700\msvcr80.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Illustrate\dBpowerAMP\dBShell.dll', no matching symbolic information found.
The thread 0x958 has exited with code 0 (0x0).
Loaded 'C:\WINDOWS\system32\browseui.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\netshell.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\credui.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\iphlpapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rtutils.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shdocvw.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\crypt32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msasn1.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\cryptui.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wintrust.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\imagehlp.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wininet.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\normaliz.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\iertutil.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\riched20.dll', no matching symbolic information found.
The thread 0xD34 has exited with code 0 (0x0).
First-chance exception in PlotLibDemo.exe (SHELL32.DLL): 0xC0000005: Access Violation.
==============================================================================
I also think there is a bug in "SetClassLong" when changing the style and CS_NOCLOSE.
Any comments or suggestions would be appreciated.
Thanks.
kostas KEL
|
|
|
|
|