|
just an idea: on creation time create also a std::map for each column and access them.
|
|
|
|
|
Hi,
Can someone tell me how to access the progress bar in status bar from CView.
for example, the following code is not showing any activity in the progress bar
CMainFrame* cfm = (CMainFrame*)AfxGetMainWnd();
cfm->StatusBarMessage("Link Verification going on...");
for( int i=0; i<800; i++ )
{
Sleep(10);
cfm->m_ctrlProgress.SetPos(i);
}
StatusBar Message is shown, but not the activity in the progress bar.
thanx in advance...
|
|
|
|
|
Use Invalidate/UpdateWindow to refresh the progress bar. Your loop doesn't service message queue, windows do not repaint themselves.
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Hello,
i want to display some Bitmaps in the MFC-PrintPreview. Die Colors of the Bitmaps are very bad.
Have someone experience with the same Problem.
Thanks
|
|
|
|
|
You may have a CBitmap in an non-compatible format for your output DC, take a look at the bitmap section in my printing article.
PrintingTricksAndTips[^]
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Please help me, I want to show a Tooltip when the User point the Cursor to a FlexGrid-ROW. If searched a lot by I haven't found....
So I tried and found out that I must use the <ontoolhittest> MemberFunktion. The problem is, to fit the variables.
How can I get the Row, on which to Cursor points? How can I find the nID...
i
nt CMyFlexGrid::OnToolHitTest(CPoint point, TOOLINFO* pTI) const
{
pTI->hwnd = m_hWnd;
//
-->??? pTI->uId = ???????????????????????????;
pTI->lpszText = LPSTR_TEXTCALLBACK;
pTI->rect = rect;
return pTI->uId;
return CFlextable::OnToolHitTest(point, pTI);
Thank you for any help!
|
|
|
|
|
HIHI,
I want to ask how to add a title in child window. Thx!!!
|
|
|
|
|
Hi
just implement it in your app's view-class. Just add a line in the OnInitialUpdate:
CMyView::OnInitialUpdate()<br />
{<br />
SetWindowText("This is my child window title!");<br />
CBaseClassView::OnInitialUpdate();<br />
}
Hope this helps!
Olli
I feel like I'm diagonally parked in a parallel universe.....
|
|
|
|
|
I have try this method, but this doesn't work!!!thanks you for your help
|
|
|
|
|
What kind of child window it is?
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
It is CView window, THX!!!
|
|
|
|
|
You could try with GetParentFrame()->SetWindowText(...), but your title will be changed by MFC. To get this right, you need to override the following CMDIChildWnd method:
void OnUpdateFrameTitle(BOOL bAddToTitle);
In your implementation, call 'GetMDIFrame()->OnUpdateFrameTitle(bAddToTitle);' first, then set the caption with a call to AfxSetWindowText (reduces flicker).
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Sorry, I am not very understand, could you mind further explain on it? Thx
|
|
|
|
|
I have include "winuser.h",why compiler report error"undeclared identifier"?
my operation system is Win98 and use vc6.0.
Hi
|
|
|
|
|
SendInput is located between the following preprocessor directives:
#if (_WIN32_WINNT > 0x0400)
...
#endif
Define _WIN32_WINNT with value greater than 0x0400 before including winuser.h and you'll be OK.
Tomasz Sowinski -- http://www.shooltz.com
Never argue with an idiot, he'll bring you to his level and beat you with experience.
|
|
|
|
|
Thank you for your reply.
I write the code according to you:
...
#define _WIN32_WINNT 0x0500
#include "winuser.h"
...
but it report the same error "undeclared identifier".
is there other reason?
Thanks again!
Hi
|
|
|
|
|
Place the #define in stdafx.h, before any #includes.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Hi GUI coders,
I try to create a ownerdraw listbox which has a fixed button in the upper right corner. Fixed button means here, it always is at the same local position (drawn over listbox entries). Basically, it should look like this (o = button).
_______________
| o ||
| ||
| ||
| ||
| ||
|______________||
I already have an ownerdraw CListbox class and an ownedraw CButton class (MFC). Now, how would I integrate my ownerdraw button? Can I use my existing button class (1. somehow one button dynamically created over the listbox)... or do I need to handle everything on my own (2. somehow inside my listbox class)??? At the end I'd like to have a new control. Thanks for any hint or ideas. Currently I have no idea how to start.
Thanks, Moak
PS: What's the idea of this control? When a user hits the new button I'll create a popupmenu showing some icons and the user can choose one. The icon will then be shown in the listbox (it's a output of a chat program).
|
|
|
|
|
This is easy. I'm assuming your app is dialog based, or CFormView based.
1. Create a class derived from CListBox ... eg CMyListBox. Does not need to be owner draw for this.
2. Add a member variable to CMyListBox "CButton *m_pButton"
3. Add an implmentation of CMyListBox::PreSubclassWindow :-
void CMyListBox::PreSubclassWindow()
{
CListBox::PreSubclassWindow();
m_pButton = new CButton;
m_pButton->Create(":o)",WS_CHILD | WS_VISIBLE,CRect(0,0,20,20),(CWnd *) this, 1);
}
4. Use Classwizard to map your dialogs List box control to an instance of CMyListBox.
5. Bob's your uncle.
Jon
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
wow. sounds easy, lucky luck joy joy thanks Jon!
PS: who is Bob?
|
|
|
|
|
Can I just ask why your using new to allocate the object? Just declare it as CButton m_Button, call create as normal, and you have reduced the risk of a memory leak. Its also faster.
BTW, you also need to call DestroyWindow() on the button in the OnDestroy of the ListBox override class.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Roger Allen wrote:
BTW, you also need to call DestroyWindow() on the button in the OnDestroy of the ListBox override class
Really? AFAIR, child windows are destroyed with parent.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
yes an answer would be interesting. perhaps I'll do some message tracing and see it the buuton receives a WM_DESTROY or not.
|
|
|
|
|
You can do some tracing, but I can tell you right now that child window will be destroyed correctly - will receive WM_DESTROY and WM_NCDESTROY.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
1. How to create the balloon tooltip?
2. Why I can't change the size of the tooltip font on WinXP (on Win98SE - OK)
CToolTipCtrl m_Tooltip;
CFont font;
font.CreateFont(<code>12</code>, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
FIXED_PITCH, "Courier");
m_Tooltip.SetFont(&font);
Best regards,
Eugene Pustovoyt
|
|
|
|