Thanks for your reply. I put the #include in the StdAfx.h file and also in that file with error. But I still got the same compiler error. I am so confused. Thanks again for your reply. Bin
bin8922
Posts
-
C2065 Compiler error. -
C2065 Compiler error.Hello, there, I got a C2065 compiler error. The error message is error C2065: 'RBN_CHEVRONPUSHED' : undeclared identifier But when I go to that line and right click on RBN_CHEVRONPUNSHED and then click on "Go to definition of RBN_CHEVRONPUSHED" I can actually go to the CommCtrl.h and see the definition. This is very strange. How could I solve the problem? Thanks a lot in advance Bin
-
How to make a function called when IE browser window size changes?I also tried DISPID_WINDOWSETLEFT, but it doesn't work.
-
How to make a function called when IE browser window size changes?Hello, everyone, In my current project, I am using BHO. I need a function to be called when the size of IE browser window changes. In the IDispatch::Invoke function, I tried to use DISPID_WINDOWSETWIDTH, DISPID_WINDOWSETWIDTH and DISPID_WINDOWRESIZE. But none of them fires when the IE browser window size changes? What should I do? Thanks a lot in advance. Bin
-
A question about using COM object.Hello Everyone, In my current code, A program calls a function in B program using "Invoke" method. B program has an exposed COM interface. It works fine. Then I added another exposed method in B program, but everytime I call it, there is an error. I tried to go thru the code. In program B, the code for the two function are exactly the same. What should I do? Thanks a lot in advance. Bin
-
CStaticLInk is not working good in CPropertyPageHello, everyone, In my project, I used CStaticLink class to change the static text to url style text. It works fine in different dialog boxes. But it is not working good in a CPropertyPage dialog box. The text is not changed to blue color and not underscored, but the link is still working good. I think the problem is from the second parameter *CWnd (in my code, I used "this"), but I cannot figure out what should it be. What do I need to do to make it work? Thanks a lot in advance. Bin
-
How to implement Help button in a property page?Thanks a lot
-
How to implement Help button in a property page?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
-
How to get the handle of a control in properties sheet.I tried to use GetDlgItem(IDOK), but the returned value is NULL
-
How to get the handle of a control in properties sheet.Hello, everyone, In my current project, I want to display xp style button(OK, Cancel and Apply) in the properties sheet. If I do it using MFC, it would be very easy. I just need to m_btnXPButton.SubclassWindow(GetDlgItem(ID_APPLY_NOW)->m_hWand); But when I tried to do the same thing in ATL, the returned handle for ID_APPLY_NOW (IDOK and IDCANCEL) is NULL. How can I get the handle of a control in the properties sheet written in ATL. Thanks a lot in advance. bin
-
How to get the handle of a control in properties sheet.Hello, everyone, In my current project, I want to display xp style button(OK, Cancel and apply) in the properties sheet. If I do it using MFC, it would be very easy. I just need to m_btnXPButton.SubclassWindow(GetDlgItem(ID_APPLY_NOW)->m_hWand); But when I tried to do the same thing in ATL, the returned handle for ID_APPLY_NOW (IDOK and IDCANCEL) is NULL. How can I get the handle of a control in the properties sheet written in ATL. Thanks a lot in advance. bin
-
How can I know the actual size of a menu?How can I know the actual size of a menu? I need to display a menu from a CToolBarCtrl toolbar. When the menu is from top to bottom, the menu should be popped up from the bottom of the bar, on the other hand, when the bar is near the bottom of the screen and the menu needs to be displayed from bottom to top, the menu should be popped up from the top of the bar. IE paints menu this way so that the bar won't be blocked by the menu. But I don't know how to get the acutal size (in pixles) of the menu. Or if I can how which way it pops up the menu, that would be better. Thanks a lot in advance.
-
How to draw a line in Edit box?Hello everyone. I want to draw edges for an Edit box. But I have to draw the lines inside the Edit box, because the edit box is too big. I tried to change the size of the Edit box, but I cannot make the height any smaller. The problem is that the line in the Edit box will be blocked by the Edit box. I tried to set the edit box to transparent, but I still cannot the lines. Any idea about how to fix this problem? Thanks a lot in advance. Bin
-
How to disable the dropdown arrow of a combo box?thanks a lot. But I just want to disable the drop down button and make it work as an edit box. I don't want to disable the whole thing. Thanks.
-
How to disable the dropdown arrow of a combo box?Hello, there, I am currently working on a project. There is a combo box. I'd like to know how I can disable the dropdown arrow of it or hide the dropdown arrow. In my project there is two setting, one is keeping the input history, one is not keeping the input history. I tried m_Combo.ShowDropDown(false)when not keeping the history, but there is a black line under it and it doesn't look good. Is there a way to solve this problem? Thanks a lot in advance. Bin
-
Tooltips for ToolBar.Hello everyone, I used the following code to implement the tooltip for a toolbar. But the tooltip won't be displayed when the toolbar window is not active. I know that I can set TTS_ALWAYSTIP to solve this problem. But I don't know how to set it. There is no CToolTipCtrl in my application. Thanks a lot in advance. BEGIN_MESSAGE_MAP(CMyView, CView) ... ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify) ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify) END_MESSAGE_MAP() void CMyView::OnInitialUpdate() { CView::OnInitialUpdate(); CEdit* pEdit = new CEdit; pEdit->Create(ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, CRect(10, 10, 100, 100), this, 111); EnableToolTips(TRUE); // enable tool tips for view } //Notification handler BOOL CMyView::OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT *pResult) { // need to handle both ANSI and UNICODE versions of the message TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR; TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR; CString strTipText; UINT nID = pNMHDR->idFrom; if (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) || pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND)) { // idFrom is actually the HWND of the tool nID = ::GetDlgCtrlID((HWND)nID); } if (nID != 0) // will be zero on a separator strTipText.Format("Control ID = %d", nID); if (pNMHDR->code == TTN_NEEDTEXTA) lstrcpyn(pTTTA->szText, strTipText, sizeof(pTTTA->szText)); else _mbstowcsz(pTTTW->szText, strTipText, sizeof(pTTTW->szText)); *pResult = 0; return TRUE; // message was handled } Thanks Bin
-
How to use TTS_ALWAYSTIP with CToolBarCtrl?Hello, I need to have the Tooltip displayed on the ToolBar even when its parent window is not active. I posted a message yesterday. I was told that I can set the TTS_ALWAYSTIP on the CToolTipsCtrl. But there is no CToolTipCtrl in my program I am using the following code and don't know how to set the TTS_ALWAYSTIP. BOOL CToolBarTipTestDialog::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult) { ASSERT(pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW); // if there is a top level routing frame then let it handle the message if (GetRoutingFrame() != NULL) return FALSE; // to be thorough we will need to handle UNICODE versions of the message also !! TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR; TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR; TCHAR szFullText[512]; CString strTipText; UINT nID = pNMHDR->idFrom; Please help me. Thanks a lot in advance. Bin
-
display tooltips on CToolBarCtrlHello, there, I'd like to know how I can display tooltips on CToolBarCtrl when the CToolBarCtrl's window doesn't have focus. I put a CToolBarCtrl in a win32 window. But it won't display the tooltips when the win32 window doesn't have focus. I want the tooltip displayed even when the win32 doesn't have focus. When I move the mouse over the button, I can see the hot tracking, but no tooltips. I noticed in IE window, the tooltips of links will show up even when the IE window doesn't have focus. Thanks a lot in advance.
-
How to display xp style button and check box.Best wishes to you
-
How to display xp style button and check box.Hello, there, I am using Windows xp and in the diaplay properties-> Appearance. I selected "Windows xp style windows and button". I think in the dialog box, the buttons and check box should be in the xp style. But when I use a VC6 to create a dialog box, the buttons and check box inside are still in the classic style. What should I do to make them xp style. Should I change project setting? Please tell me how to do it. BTW, I tried to compile the code that I downloaded from Internet, the buttons are in XP style. Thanks a lot. Bin