That depends on how you made the application. If you're using the document/view architecture then just make the view class a CFormView (it's the last step when using the wizard). If not then use this workaround: (a) Create a dialog resource, and make a class for it. MAKE SURE TO OVERRIDE THE OnOk and OnCancel functions. (b) In your application add the dialog as a member variable. (c) In your applications' OnCreate function, create the dialog by calling CDialog::Create, put WS_CHILD | WS_VISIBLE for the style. DO NOT CALL DoModal.
agentnem
Posts
-
MFC loading form -
Change style of window owned by another app in 98? Works in XP.It's possible that the window of another process "undos" any changes made to it. I know of some programmers who put code in their MFC applications to prevent certain window style changes. I believe the Windows Media Player exhibits this behaviour. If this other process is of your own creation, then you may want to use user-defined messages to invoke certain behaviour.
-
mouse eventsHi I'm having a lot of problems with mouse events. In an MDI application I have a CDialogBar derived class which needs to keep track of mouse movements in the parent frame. Using the ClassWizard I've added the necessary functions but they don't work. Within the CDialogBar derived class there's a CEdit object. Within the WM_NCMOUSEMOVE event handler the CEdit object has it's window text set to the mouse position. Well nothing happens. The application runs, but for whatever reason the dialog bar doesn't get the non-client mouse move event. I've added handlers for WM_NCLBUTTONDOWN and WM_NCLBUTTONUP but nothing happens. Can anyone tell me what's going on? How do I make my CDialogBar derived class capture mouse events in the parent frame?
-
Creating Add-in for Visual Basic EditorI have found an example that uses C++/ATL to make a COM add-in for Office, but I'm new to ATL/COM and am having difficulties understanding it. If you do a search on msdn.microsoft.com for "comaddin.exe" you'll find it.
-
Can't prevent new window opening!If I understand you correctly, the right pane is actually an HtmlView displaying a web page. In any case, to redirect a link to a specific window you have to use the "target" property. For example: // somewhere in an HTML file Click here "target" accepts any of the following: _blank, which opens the link in a new window _self, which opens the link in the current window _parent, which opens the link in the parent window _top, which opens the link in the top most window Hope this helps.
-
Change style of window owned by another app in 98? Works in XP.I don't know which version of MFC you're using, but CWnd::ModifyStyle doesn't have a parameter for window handles. According to Microsoft documentation (msdn.microsoft.com/library/default.asp), the function is defined as: BOOL ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0); So you don't need a window handle, just a CWnd pointer to the application in question (I don't know how to do that myself, but I'm sure other forum members can help):suss:.
-
Creating Add-in for Visual Basic EditorHello all. I need some help regarding add-ins. I want to create an Add-in for the Visual Basic Editor (open any Office application and hit Alt+F11 to see what I'm talking about). I also want to make it using Visual C++ since that's what I'm familiar with. I don't have any experience with ATL/COM (yet), so if anyone out there can provide some information I would be very greatful. A step-by-step guide would also be helpful. At the very least, some links/code snippets to get me started. Thank you.
-
Add-ins, creating using Visual C++ : Help!:confused:Hello I'm new to COM and ATL. I need some help regarding add-ins. I want to make an add-in for the Visual Basic Editor, displayed as a dialog-style window, using Visual C++. I know that COM and ATL are used, but I have no idea how to start. Also, the displayed dialog needs to keep track of the currently selected item (i.e. a Form, or a control within a Form) and read it's properties (color, text, etc.). I have looked over the articles discussing add-ins, but they don't address my situation. Any help would be greatly appreciated. Thanks.