MDI support in ATL composite control

Hi,

I have components created in ATL. The components are ATL composite
controls. Entire work has been done till now using ATL, however I now
need to give MDI type of work area (based o doc-view architecture)
within the control.

I have class derived from CMDIFrameWnd. However when I try to
initialize instance of this class by calling "Create" method of
CFrameWnd (base class in CMDIFrameWnd), I get error and creation fails.
Tracing the code, I found that base class create method calls
"AfxGetInstanceHandle" to get handle to the DLL. Now since this is ATL
Composite control, this method fails.

This indicated to me that I am trying to mix two technologies. Is this
really true? Please guide me as to how to provide MDI architecture
support within ATL Composite control. One option is to re-create
everything in MFC-COM but that would require re-architecting and is not
really possible. Is there some golden mean?

Thanks in advance.

Best regards,
Mandar

0
mandards (11)
4/9/2006 6:11:07 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
675 Views

Similar Articles

[PageSpeed] 19

Did you check the option to support MFC when you created
your ATL DLL project?

BTW, you don't need MFC for MDI, though I admit it'd be
painful without it. However, there's WTL:

http://sourceforge.net/projects/wtl

-- 
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"win_cpp" <mandards@gmail.com> wrote in message 
news:1144563067.802399.212670@j33g2000cwa.googlegroups.com...
> Hi,
>
> I have components created in ATL. The components are ATL composite
> controls. Entire work has been done till now using ATL, however I now
> need to give MDI type of work area (based o doc-view architecture)
> within the control.
>
> I have class derived from CMDIFrameWnd. However when I try to
> initialize instance of this class by calling "Create" method of
> CFrameWnd (base class in CMDIFrameWnd), I get error and creation fails.
> Tracing the code, I found that base class create method calls
> "AfxGetInstanceHandle" to get handle to the DLL. Now since this is ATL
> Composite control, this method fails.
>
> This indicated to me that I am trying to mix two technologies. Is this
> really true? Please guide me as to how to provide MDI architecture
> support within ATL Composite control. One option is to re-create
> everything in MFC-COM but that would require re-architecting and is not
> really possible. Is there some golden mean?
>
> Thanks in advance.
>
> Best regards,
> Mandar
> 


0
agnickolov (50)
4/10/2006 7:04:17 PM
Reply:

Similar Artilces:

MDI appliccation problem
Hi, I am working on an MDI application. I am haveing a strange problemin this application. I have 2 dialogs in the main MDI application (Common settings & standard about app dialog). I have my Doc/View/Frame coming from various DLLs. When I start my application, and use the dialogs (common dialog OR About App) it works fine (i.e. dialog s are displayed properly with proper filled values). Now I create a new instance of a Document by clicking New in Fuile Menu or Ctrl+N (I have 2 document types available right now), and then close the document (by Close in File menu or Ctrl+F4). After ...

MDI within MDI?...
Hi All, I have an MDI app where I want each child window to in turn host another MDI parent, allowing a managed frame of children for each top-level MDI child. The purpose is a "workspace" driven UI where the top-level children are maximised and displayed as tabs only, but each has to be able to host further framed windows within it. I am not an MFC expert on MDI/SDI, nor on the underlying API requirements. I have been able to create primitive child frame in the top-level view's OnInitialUpdate, specifying the view as the parent, which does bounds clipping OK, however I'm l...

How to get the Mouse Up event for a custom activeX control ?
Hi, I am using MFC and an activeX control.. I am putting my activeX control on the form.. Now, I want to have the mouse up event for this control... like if user presses mouse key anywhere on the control and leaves that key, i want to capture that event... So, is there any way to get that using MFC... ?? Please help me.. ===== Regards, Jigar Mehta If your control is in MFC, you should get the event as you normally would using the right macros. Your control should fire an event if you are trying to capture it outside the control (host). ----------- Ajay Kalra ajaykalra@yahoo.com ...

Creating Document in MDI app
Hi, In my application I wish to be able to export certain data to another file. In one of the functions in my view I need to create a new document, call some functions on it then save and close the document. I am struggling to find how to do this. I have only one Document template in my app. The code I have so far is: POSITION p = GetApp()->GetFirstDocTemplatePosition(); CDocTemplate* pTem = GetApp()->GetNextDocTemplate(p); CBob_photoDoc* pDoc = (CBob_photoDoc*) pTem->OpenDocumentFile(GetApp()->m_pProfStrs->DefFile,false); CBob_photoDoc is my document class. I can now...

Tab controls #2
Hi, How do i create tab control in mfc with some other buttons too. And also i am not able to toggle the next tab too. Why is it? pls help me Thanks, Krish Krish wrote: > Hi, > > How do i create tab control in mfc with some other buttons too. And > also i am not able to toggle the next tab too. Why is it? > > pls help me > > Thanks, > Krish The easy way is to use CPropertySheet and CPropertyPage. The help has step by step instructions for using these. -- Scott McPhillips [VC++ MVP] ...

How to set MDI view as background view?
I am developing a MDI application and have the requirement to allow for the definition of a single background view. By using a bulletin board analogy, it is more clear what is needed. In this analogy, the background view would be the bulletin board and all other views would be the flyers in the foreground. I have no problems implementing this by changing the z-order of the desired background view by calling the frame window's SetWindowPos() method, provided that no view is maximized. However, I need to implement this capability regardless of the window state; normal, maximized, minimize...

User Defined Grid Control
Hi, Just wanted to know if somebody created user defined grid control (Like MSFlexGrid) in vb6. I require help if anyone provide the code or path to download the file. Thanks in advance, Best Regards, <vikram_singh@hotmail.com> wrote in message news:1193150289.958502.45690@v23g2000prn.googlegroups.com... > Hi, > > Just wanted to know if somebody created user defined grid control > (Like MSFlexGrid) in vb6. I require help if anyone provide the code > or path to download the file. Well, have your considered a continues form? They are native and built into ms-access....

Question about the Animation Demonstration at ASP.Net AJAX Control Toolkit site
The animation demonstration at the ASP.Net AJAX Control Toolkit site shows a "flyout" panel with a "close" control. The demo is quite good. See http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Animation/Animation.aspx Unfortunately, the author did not supply much information about how this was implemented. The "flyout" target control was a <div> tag which may have been created from an <asp:Panel> control, but the author did not bother to say! A few things can be learned by viewing the source code underneath. A Javascript function ca...

creating different emails dependant upon a control value
I want to be able to produce two different emails. one with just standard financial info on (got this working) and one with additional variation info on (not working) i need someone to look at the code i have below and highlight where i have gone wrong and what needs to be done. i am using Access 2000 and Outlook 2002. thanks in advance Private Sub Form_Open(Cancel As Integer) 'Arvin Meyer 03/12/1999 'Updated 7/21/2001 'ammended by Peter Coxsey 28/06/2007 On Error GoTo Error_Handler Dim objOutlook As Outlook.Application Dim objEmail As Outlook.MailItem 'Dim objEmailS...

Does Excel support endnotes?
I want to insert endnotes into my excel spreadsheet to track sources used for each cell. Not endnotes, but Comments. Select the cell you want to document, then press Shift-F2 & type your notes Cells with documentation/comments are denoted by a small red marker in the top right portion of the cell. Hovering your mouse over one of these cells displays the comment. To be sure the red markers are visible, select Tools | Options from the menu and go to the View tab. Make sure the middle or right option under 'Comments' is selected. "Karen_Harner" wrote: > I wan...

Mulitiple Select in ListBox Control
Hi all, I need the code for transfering multiple selected items from listbox1 into listbox2 on clicking a button in vc++. Looking forward for the reply... Thanx in advance... First, use CListBox::GetSelItems on the first listbox, then use CListBox::GetText on each of the indexes (or indices) returned and use CListBox::AddString to add these items to the 2nd list box. -- Regards, Nish [VC++ MVP] http://www.voidnish.com http://blog.voidnish.com "Prince" <princevictor.moses@gmail.com> wrote in message news:1124696946.039115.106730@f14g2000cwb.googlegroups.com... > ...

How to move focus / active control using Enter key?
I've ever seen an application that moves the active control using Tab or Enter key. So the application has a few Combo Boxes, CEdit, Checkboxes and to move from one control to another, we can use either Tab or Enter key. How to do that? I've tried to find it but I still haven't found any. Thank you very much. You need to deal with WM_KEYDOWN message for Enter key. Simply explains below: 1.In the recieving function for WM_KEYDOWN, catch the key 'Enter'. 2.Call GetNextDlgTabItem API to get the next control which is capable to tab 3.Call SetFocus on the control Thanks...

Sending data to different control sources
My addled brain needs some help! My database is for a volunteer victims in crisis organization. The heart of it is an incident form which contains data relevant to each individual incident.One section has 6 drop down boxes which all get their row source from the same table, which contains all the organizations to which a victim might be referred. Thus any victim could be referred to up to 6 different places. Each DD box has its own control source field. The form works great, but I have to generate a report which lists all the organizations and the number of referrals made to each. ...

Problem with Full Screen MDI application
Hi all, I have added full screen functionality to MDI application as per fscrn.exe sample provided by microsoft. The problem is when I minimize the application (provided a minimize button on toolbar), and after that lock the computer and log in again, and click on taskbar to show application again, then menubar associated with application shows up. It does not go even if I minimize the application and again show it back. This problem is not present when I just minimize the application without locking the computer. It does not show menubar that time. Please help me. Thank you, Sandeep Kulkarni ...

trouble with Winsock control....
I didn't have any luck posting this over in the 'Controls' group, so I'm reposting it here: Hi All, I'm sure this has been covered before, but I haven't found anything that seems to help. I'm trying to read the raw html data from a web page, so that I can parse it and extract the information I need. The data is primarily text that I wish to capture. When I try to grab a page using the Winsock control, I get a 'page not found error'. I know that the URL and page location are correct because I can see a test file using a web browser. ...

Stock control spreadsheet
I thought I had posted this previously but ommited the subject and I don't think it did post. Although I have used Excel for years I have never had the need to use a complicated formula. I am trying to set up a stock control spreadsheet where multiple items are deducted when I click on one cell. What I am trying to do is each time I click on cell A3 "Item" all the amounts in C will be deducted from D and the difference between B and D will show in E A B C D E 1 ...

AxtiveX ctrl subclassing custom control
Hi! There are plenty of examples where ActiveX ctrls are subclassed from Windows controls such as BUTTON, EDIT, etc. I've got custom control based on CRichEditCtrl, and I'd like to build ActiveX ctrl subclassed from it. I'm not quite sure how this should be done. In all examples I found the approach is like this - BOOL CActiveXWrapperCtrl::PreCreateWindow(CREATESTRUCT& cs) { cs.lpszClass = _T("EDIT"); return COleControl::PreCreateWindow(cs); } well, my custom control does not have registered name, so what should i do? many thanks kdv09 ...

Technical support options for Great Plains
Hello. I am doing some freelance tech support for a client. They run Great Plains under Windows 98 using two computers networked via a linksys router. They are running Great Plains Accounting under DOS, actually. I'd like to set them up so that both computers can access the same database. Is there any way for me to receive tech support for this situation? I appreciate any assistance. Thank you again. Dan Speziale Dan, Great Plains Accounting for DOS is an obsolete product and is no longer officially supported. There are still a few old-time GPA gurus who might be able to help you; ...

Creating dinamically a VB Licensed Control in VC
Hi, Is there any way to create dinamically in VC6++ an instance of a VB6 Licensed User Control? I try to pass the License key as the last parameter to the Create method of the wrapper, but it still doesn't work. Any ideas? thanks in advance javi ...

ODF Support in Office 2008?
I have a client that is exclusively using ODF - in the eitire corporation. I like how they use open source software throughout the entire corporation, but this presents a problem for those of us who use Office 2008. DOes Office 2008 Support ODF? From what I researched, there is no update available that will give Office ODF support. Is that true? That is true. Office 2007 added ODF support with the SP2 update, but the Mac version does not have it. However, you can download OpenOffice.org or NeoOffice for free; these open-source applications use ODF as their native file format (and are pro...

Printing MFc controls
Hi, I have an application that uses a the DataGrid control to store information from a database. I would like to be able to print the contents of the DataGrid control, preferably in same format. Does anyone know how this can be done? Regards Macca Some controls respond to WM_PRINT message. I'd tend to write my own output handler simply because that way I'd know what I was getting, and could add useful features like page headings and the like. joe On Wed, 8 Jun 2005 06:02:02 -0700, "Macca" <Macca@discussions.microsoft.com> wrote: >Hi, > >I have an ap...

Using a variable to refer to a control in VBA
Good Afternoon, I was wondering if any one can tell me how to fix the 3rd line to work like the 2nd one does. The 2nd one works fine but one the 3rd one they system throws an error. thanks! Dale Dim intloop as integer intloop=8 Forms![frmDate]![frmsubMonth].Form![subForm8].visible = False Forms![frmDate]![frmsubMonth].Form!("subFrom" & intloop & "").visible = False Dale K wrote: >Good Afternoon, > >I was wondering if any one can tell me how to fix the 3rd line to work like >the 2nd one does. The 2nd one works fine but one ...

MDI with DLLs
Hi I want to create an MDI application that will have different views. It will need form views, views and listview. I can do this with no problem using just an regular exe with all the code in it, but I want to be able to put all the code and resources of the view classes and other part of the programs in dlls so if I find a problem in one part of the program I will only update the dll where the problem is. How do I do this? How do I load a child view from a dll? What is the best way to do this "Alfredo" <anonymous@discussions.microsoft.com> wrote in message news:94099A9B-...

ActiveX controls cause Excel to Shutdown
Last night I was doing some simple coding in VBA. The code applied to two command buttons: one would copy and paste a line along with adding a few check boxes, the other would delete said line and boxes. I saved one of my first stabs at the code, and when I went to add another command button Excel would shut itself down and auto recover my previous work. I had been seeing the error "object library invalid or contains references to object definitions" before this began happening. I have Microsoft Office 2003 and have tried re-installing it, to no avail. Every time I use the Activ...

integration MDI child views from VC i VB into one MDI App
Hey, I’d like to integrate two applications: First is MDI application written in Visual C++ 6.0. Second is dialog-based application written in Visual Basic 6.0, but I suppose that we can change the main dialogs to MDIChild forms. Both applications are in DLLs at all. Is it possible to use a MDI child forms created in visual basic 6 and in visual studio c++ together in one MDI application? I suppose that main MDI application should be written in VC++, because it’s extremely flexible and I know this environment the best, but maybe I’m wrong :). Maybe for example in C# .net it’d be easier...