|
Call AfxInitRichEdit(), that should help.
Mickey
|
|
|
|
|
Hi !
I heared about a software called 'v-tune', which let you check where you have memory leaks in your application and in which method the most time is spent.
I'd like to know if there is an equivalent tool, maybe not as powerful as v-tune but which would be free.
Any suggestions ?
Thanks !
Jerome
|
|
|
|
|
If you're using VC 7.x you can try DevPartner Profiler Community Edition http://www.compuware.com/media.asp?cid=3019X36 [^]for profiling. It won't do memory checks though.
It plugs into the VS.NET IDE. (I've not used it though.)
DevPartner Profiler features:
pinpoints performance bottlenecks
profiles managed VB .NET, VC++, C#, JScript 7 and unmanaged VC++
highly accurate results
verify code changes have improved performance
tightly integrated to the VS .NET IDE
supports Visual Studio .NET 2003 and 2002.
Kevin
|
|
|
|
|
This code stolen from the docs on _CrtSetDbgFlag in the MSDN could provide a preliminary leak check for _DEBUG builds.
#include <crtdbg.h>
.
.
.
int tmpDbgFlag;
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR );
tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
tmpDbgFlag |= _CRTDBG_DELAY_FREE_MEM_DF;
tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
_CrtSetDbgFlag(tmpDbgFlag);
.
.
.
On app exit, you should see a dump of any leaks detected. Locating their origin is the next step - not always easy. See the msdn under using the debug heap.
|
|
|
|
|
1) I'm sorry, but I know this is a real newbie-question: how do I make an array for for instance UINT's or doubles, or CButtons?
2) Is there a possibility to determine (fast!) what the highest or lowest value in an UINT- or doubles-array or list is?
I need this, because I've planned to make
1) my very own CHistogramCtrl
2) a (useless) dialog, containing one button, that devides itself into 4 new ones after clicking on it (and so on: click on one of the new buttons and it will start over again).
|
|
|
|
|
DaFrawg wrote:
how do I make an array for for instance UINT's or doubles, or CButtons?
UINT uArray[5];<br />
double dArray[10];<br />
CButton btnArray[3];
DaFrawg wrote:
2) Is there a possibility to determine (fast!) what the highest or lowest value in an UINT- or doubles-array or list is?
The lowest value is always going to be zero. The highest value is always going to be the number of elements minus 1;
int nCount = (sizeof(uArray) / sizeof(UINT)) - 1;
Since you are using MFC, you might want to look at the CArray -related classes.
|
|
|
|
|
DavidCrow wrote:
The lowest value is always going to be zero. The highest value is always going to be the number of elements minus 1
Doesn't he mean the element with the largest value?
Kevin
|
|
|
|
|
I'm not real sure. Even though the word 'value' was used, I took it with a grain of salt. Folks' use of words in these forums vary so much, it's hard to assume anything.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
How much of a beginner are you? Are you a beginner of VC++/MFC only or are you also fairly new to C++?
Apart from David's answer below you could also try using the vector class with the max_element algorithm. If you type "max_element" in the Help index and click on the Sample program link there is an example showing how to use it.
It is also possible to use max_element on a raw array, if you find that easier to get your head round.
double histogram[] = { 1, 4, 4, 6, 1, 2, 2, 3, 1, 6, 6, 6, 5, 7, 5, 4, 4 };<br />
int count = sizeof(histogram) / sizeof(histogram[0]);<br />
double* begin = histogram;<br />
double* end = histogram + count;<br />
double* maximum = max_element(begin, end);<br />
afxDump << "Maximum = " << *maximum << "\n";
You should also "include <algorithm>"
Kevin
|
|
|
|
|
#include <algorithm>
Kevin
|
|
|
|
|
I'm a beginner of VC++/MFC, but I still don't get some C++ basics, like working with 'friend' and 'operator' and arrays, especially when they're declared to be a class member (this isn't good English, is it?).
But if I understand it well, max_element is a macro (or function, whatever) in <algorithm.h>. Is that correct? If it is, it'd really help me.
|
|
|
|
|
Hi all,
usually when i try to handle EN_CHANGE i catch it in my dialog.....
now, i have a class that inherits from CEdit. i want to handle the EN_CHANGE with in that class....
what can i do??
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Have an ON_REFLECT_COMMAND handler in your derived class.
Steve S
|
|
|
|
|
How do I determine if a slider is changed? There is no message for that.
(So, if I fiddle around with a CSliderCtrl, what message or whatever is sent/whatevert?)
|
|
|
|
|
Spin button controls send you a WM_HSCROLL or WM_VSCROLL message. Not sure what a slider does
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
As already said, spin controls send WM_H/VSCROLL messages.
Sliders = Trackbar controls send TB_LINEUP etc.
Look in the Platform SDK under User Interface Services > Windows Common Controls.
OK?
|
|
|
|
|
A spinbutton control sends UDN_DELTAPOS to its parent window when it's spun. lParam is the address of "an NMUPDOWN structure that contains information about the position change" (to quote MSDN).
Sliders send WM_HSCROLL and WM_VSCROLL messages.
|
|
|
|
|
How can I receive those messages? ClassWizard doesn't show them. Should I add them to the message map manually?
|
|
|
|
|
You can get ClassWizard to add handlers for UDN_DELTAPOS messages , but I can't remember how I think you just select the spinner control and add a message handler for it. Have a look at my article at http://www.codeproject.com/dialog/CRHChildDialog.asp . Although it's not specifically about spinner controls, it does use them. So if you search the source files for DELTAPOS you'll see what happens.
|
|
|
|
|
DaFrawg wrote:
ClassWizard doesn't show them
Right-click on the Dialog class that contains the spin control. In the window that appears, select the IDC of the control you want to receive notifications about, in the "Class or object to handle" listbox.
UDN_DELTAPOS should appear, along with NM_OUTOFMEMORY, in the "New Windows messages/events" listbox on the left hand side.
There you go!
Sliders receive both the WM_HSCROLL and WM_VSCROLL messages. You can either handle them in the control itself, or through the parent dialog.
The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices.
[Roger Wright on stupid people]
We're like private member functions
[John Theal on R&D]
We're figuring out the parent thing as we go though. Kinda like setting up Linux for the first time ya' know...
[Nitron]
|
|
|
|
|
hi,
my application is using mysql as backend. for database connection i am using mysql files from mysql site.i try to build exe in release mode. i got linker error "unresolved external symbol" for mysql class member. in debug mode i got warning only.
thanks in advance.
|
|
|
|
|
Have you added a .LIB file to the build, and only added it in the debug build?
Steve S
|
|
|
|
|
Hi,
Thanks For Ur Help.
Murali.M
|
|
|
|
|
Hi,
I want to create 4 radio buttons of which two form one group and other two form another group on a dialog.I should be able to select one button from each group(i..e two buttons in total).How can I do this?
Karteek
|
|
|
|
|
You need to set the windows style WS_GROUP on the first radio button in each group, and make sure that the tab order has each pair together.
Steve S
|
|
|
|