|
I don't remember what entry-point I must specified in an MFC project file when I compile in UNICODE. Could you help me ? Thanks.
|
|
|
|
|
|
Hi!
I want to get the message when the left mouse button is down on a tree ctrl. But this tree ctrl is of type CTreeCtrl and not of any class derived from CTreeCtrl. So, when I add a handler for this message in the dialog that holds this tree ctrl, it doesn't recieve this message! It recives only when the left mouse is down on the dlg and not when it is down on the tree ctrl. How can I get this message when the left mouse button is down on the tree ctrl.
Thanks,
NC
|
|
|
|
|
what do you mean by
" But this tree ctrl is of type CTreeCtrl and not of any class derived from CTreeCtrl. "
anyway,add the handler when the id of the tree is selected in the id list of the class wizard.you might have added for the dialog itself.
bye.
|
|
|
|
|
Hi!
Thanks for replying.
There is not WM_LBUTTONDOWN for the tree ctrl. How else can I add this to message map and also add a handler?
Thanks,
NC
|
|
|
|
|
You need to Know if the pointer is in the TreeCtrol....
Get the mouse Pointer Position and ask if into the Square that define the control
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hi!
Thanks for answering.
Where do I check if the mouse position is on the tree ctrl?
Thanks,
NC
|
|
|
|
|
You can use CRect::PtInRect where the point is the mouse pointer and the Rect the TreeControl coordinates. Don't forguet to call CRect::NormalizeRect Before to call PtInRect
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
You can use CRect::PtInRect where the point is the mouse pointer and the Rect the TreeControl coordinates. Don't forguet to call CRect::NormalizeRect Before to call PtInRect
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
As you want to handle the WM_LBUTTONDOWN before it goes to the TreeCtrl, I would override PreTranslateMessage() as follows:
BOOL CYourDialog::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_LBUTTONDOWN)
{
CPoint p ;
GetCursorPos(&p) ;
CWnd *pWnd = GetWindowFromPoint(p) ;
if (pWnd != NULL)
{
if (pWnd->GetDlgCtrlID() == ID_OF_TREE_CTRL && pWnd->GetParent() == this)
{
}
}
}
return CDialog::PreTranslateMessage(pMsg);
}
Its all written from memory, so some calls/parameters etc may not be correct, but it should do something close to what you need.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
|
|
|
|
|
Hi, I am trying to use GetActiveIndex() in the property sheet to get the index of an active page. I encountered a problem in GetTabControl() which returns 0xcccccccc. I believe the setup of my property sheet and pages should be right by using DoModal() and AddPage(). Please give me some suggestions on troubleshooting this problem. Thanks!
|
|
|
|
|
Are you calling GetTabControl before DoModal?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
I called GetActiveIndex() after DoModal() and Addpages(). If I go straight to display data on the first page, it works fine when I am on the first page and vice versa on the other pages. However, I would like to display data by the active page which gives me more flexability.
|
|
|
|
|
Hi, I'm trying to create a save dialog box with 2 filters. How can i update the extention in the filename whenever the "Save As Type" box is highlighted.
Thanks
|
|
|
|
|
I've just started learning how to debug, and I'm still kinda new with C++ programming language.
I have two variables declared as doubles: x, slope
while debugging, I noticed that sometimes in the loop they're values came up as:
slope = 1.#INF000000000
x = -1.#IND000000000
what does that mean?....why does it happen?
|
|
|
|
|
(EDIT: Corrections)
1.#INF stands for positive infinity.
1.#IND stands for positive ideterminite.
If you add a negative, then they are negative infinity.
This can happen if a variable has yet to be initialized. It can also happen during ASCII to float conversions and math operations.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
So can I use that value just like other values in my code, for example in an if statement, could I say:
if(x==1.#INF)
{
//do stuff
}
or when I say
if(x>=9000)
{
//do stuff
}
will the infinite value be regarded as greater than 9000?
|
|
|
|
|
You can use _finite to test to see if a value is finite. Thus your NAN, QNAN, INF, IND should return false. (???)
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
1.#INF means positive infinity - usually you get it when you divide by zero. 1.#IND represents so-called 'quiet-nan' - for example, when you take the logarithm of negative value.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
So can I use that value just like other values in my code, for example in an if statement, could I say:
if(x==1.#INF)
{
//do stuff
}
or when I say
if(x>=9000)
{
//do stuff
}
will the infinite value be regarded as greater than 9000?
|
|
|
|
|
Don't - instead figure out what is setting the bad values.
Those numbers indicate that you are doing something wrong. If the variables are uninitialized there is no guarantee that they will always be the same. If you are dividing by 0 or taking the log of a negative number you should be checking your inputs because they are faulty.
Dave Huff
There are no small projects - only young ones.
|
|
|
|
|
1.INF/-1.INF = Positive/Negative infinity
1.IND/-1.IND = Positive/Negative indeterminate
1.QNAN/-1.QNAN = Positive/Negative quiet not-a-number
1.NAN/-1.NAN = Positive/Negative not-a-number
IEEE Reference information
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hi,
Can someone tell me ,
How to show and handle CFormView in
an ActiveX Control.
Thanks,
Sansky
God is Good, all the Time.
All the Time, God is Good.
|
|
|
|
|
FormView wasn't really designed for placing in an activex control. What are you try to achieve as there may be a better way.
I'm guessing you are wanting an activex control made up on a number of other controls? Have a search on MSDN for composite controls.
Michael
|
|
|
|
|
Hi,
Actually trying to develop an ActiveX , where I can
show other some ActiveX's , which also needs to be dragged.
So I believe that I need CFormView for this.
According to the art Q155973, this is possible , but I am
unable to find the sample DLGX.EXE at microsoft.com,
any suggestions .
God is Good, all the Time.
All the Time, God is Good.
|
|
|
|