|
Hmm, ok, I'll try that, but what about the general principal - is the act of "dbl clicking" some how sending a second focus message back to the control you dbl clicked on so that it stays focused? Plus what do you do if the iten has no children? Then it will NOT recv a TVN_ITEMEXPANDED will it, as there is nothing to expand!?
Curiously, I even try *posting* a WM_SETFOCUS message to the edit control, which had the weird effect of activating the edit's caret, so it was flashing on and off, but the focus was still with the tree control! And keyboard input still went to the tree control!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Muwahhhhhaaaahaahaa!
Eureka!
The key is to NOT allow the Default WndProc to get called!
So in MFC land:
void CLeftView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
CMainFrame* frm = (CMainFrame*)AfxGetApp()->GetMainWnd();
CFocusTestView* view = frm->GetRightPane();
view->SetFocus();
}
Note: I commented out the call to the super classes handler. If I put this back, I get the weird behaviour again. Bizarre, but it works. I wonder what weird hidden things this breaks?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
yes it will happen, but dont comment it out,instead put it as the first line in the method.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
I'm using SQLExecDirect() to process 'INSERT INTO' statements. I was doing them one insert at a time, but this seems to be slow. I don't wanna use SQLBulkOperations() because that requires binding of the columns which really doesn't seem to be appropriate seeing as this is an import from MySQL to a .dbf or .xls and is pretty dynamic. The problem is this. The regular insert stament works but I'm trying to get one to work like this:
INSERT INTO tblPeople (Firstname,Lastname) VALUES ('John','Doe');
INSERT INTO tblPeople (Firstname,Lastname) VALUES ('Jane','Doe');
INSERT INTO tblPeople (Firstname,Lastname) VALUES ('Mary','Doe');
with the above statements all in one string. The text is formatted right, but the odbc error I get is 'connection error'. Can anyone help? thanks
If it's broken, I probably did it
bdiamond
|
|
|
|
|
'connection error' is a message I had for myself that was cut and paste in the wrong place. So that isn't the error. I do have an odbc error handler, but I'm not getting a message or error number when the statement doesn't execute
If it's broken, I probably did it
bdiamond
|
|
|
|
|
You can only execute query batches against providers that support query batches, such as MSSQL Server and Sybase.
onwards and upwards...
|
|
|
|
|
thanks!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I have an application with an edit control. I need to write integer values to it...but I want to be able to change the font size to make the number as large as possible. I would also like to set the color. Can someone tell me how to set the font and color?
Thanks.
Jerry
|
|
|
|
|
Assuming the edit control is owned by a dialog, declare a font object in the dialog's class. Then in the OnInitDialog() method, create the font, and call the edit control's SetFont() method.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
You'll find that all CWnd derived classes will be similar.
classes? we don't need no stinkin' classes.
|
|
|
|
|
Hello, everyone,
I'd like to know how to handle the help button in property page. In my property page, there are OK, Cancel, Apply and Help button. For OK, Cancel and Apply button, it is easy to handle. I just go to ClassWizard->Message Maps to add function OnOK, OnCancel and OnApply, and then put code into the functions. But I don't know how to handle the help button.
What I can only think of is to get the rect of IDHELP button and then handle the mouse left click message. But I think there should be more straightforward way to handle it.
If you know how to handle it, please drop me a couple lines.
Thanks a lot in advance.
Bin
|
|
|
|
|
Add the following statement to the sheet's message map:
ON_COMMAND(ID_HELP, OnHelp) In the function that creates the sheet object, add:
sheet.m_psh.dwFlags |= PSH_HASHELP;
page1.m_psp.dwFlags |= PSP_HASHELP;
page2.m_psp.dwFlags |= PSP_HASHELP;
...
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Hi All!
Please help me with one thing:
When i create listcontrol with such styles (LVS_OWNERDATA LVS_EX_CHECKBOXES) - checkboxes are hidden!
How to force my list control to work with this styles???
Thanks in advance!
|
|
|
|
|
From the docs:A virtual list-view control maintains very little item information itself. Except for the item selection and focus information, the owner of the control must manage all item information. Since the checkboxes are implemented using the state image list, when you put the list into virtual mode, the list no longer keep the state image info itself.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Hallo C++ world,
I would be appreciate your help!. I've a class with a CMap<int,int,cmyobject,cmyobject&> member variable. I have to store in it aprox. 8000 CMyObject elements. But after the 4600th element I get a CMemoryException.
I tried with a CArray<cmyobject,cmyobject&> variable. Here can I store only 1500 elements.
Can anyone tell me how can I work around this problem using a MFC collection.
With kind regards,
Reinaldo
Reinaldo Casamayor
|
|
|
|
|
Reinaldo Casamayor wrote:
But after the 4600th element I get a CMemoryException.
What is the text of the exception? Use either GetErrorMessage() or ReportError() for this.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
A CMemoryException typically indicates that new failed. MFC redefines the global operator new .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi,
I'm calling CListCtrl CustomDraw from a dialog, and I'm getting in trouble when I try to retrieve the column number that is currently being drawn ( I get a column number like 1242244).
What I make is:
<br />
void CRolesDlg::OnCustomdrawRoles(NMHDR* pNMHDR, LRESULT* pResult )<br />
{<br />
(...)<br />
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;<br />
<br />
int iCol = lplvcd->iSubItem;<br />
(...)<br />
}<br />
And I get that strange iCol number , any ideas about why this happens ? It's a bug from MFC ? A bad casting ?
Greetings
Braulio
|
|
|
|
|
You left out a lot of code there... are you checking the draw stage? Returning the right CDRF_* flags to get notified of the draw stage for subitems?
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Hi Michael,
The full code of the method is:
<br />
void CRolesDlg::OnCustomdrawRoles(NMHDR* pNMHDR, LRESULT* pResult )<br />
{<br />
<br />
NMLVCUSTOMDRAW* customDrawItem = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);<br />
<br />
<br />
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;<br />
<br />
int iCol = lplvcd->iSubItem;<br />
int iRow =0;<br />
switch(lplvcd->nmcd.dwDrawStage)<br />
{<br />
<br />
case (CDDS_SUBITEM):<br />
if(lplvcd->iSubItem == 1) {<br />
AfxMessageBox("");<br />
}<br />
break;<br />
<br />
default:<br />
*pResult = CDRF_DODEFAULT;<br />
<br />
} <br />
}<br />
I tried several things...
|
|
|
|
|
Hi Michale,
I'm following you article "Neat Sutff to do in List Controls Using Custom Draw", now things are going better
I hate to do things like this with MFC/ATL... when guys making sh*t with Visual Basic can do it in five minutes
Thanks for your help, Bye !
Braulio
|
|
|
|
|
I am using the VC++ date/time picker control. I want to select a date and then calculate the total seconds from 01-Jan-1980 until the selected date. Also I want to store this as an unsigned long int.
Do you know of a simply way to do this?
|
|
|
|
|
Store each of the dates in a COleDateTime object. Assign the difference to a COleDateTimeSpan object.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|