Cloning a View in Dialog-based MFC Program, part 2

I've created a toolbar button fort he cloning operation and the function it
calls invokes a constructor for a new view.  Using the debugger I can see
that this new view has all of the right data ... but it has no window!
What's my next step?

TIA
    Norm


0
ndrez (136)
9/2/2003 5:35:32 PM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
658 Views

Similar Articles

[PageSpeed] 13

I dont know the context of your action but make sure that you make the view
and its parent frame are both visible.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


"Norm Dresner" <ndrez@att.net> wrote in message
news:Ex45b.125557$3o3.8831281@bgtnsc05-news.ops.worldnet.att.net...
> I've created a toolbar button fort he cloning operation and the function
it
> calls invokes a constructor for a new view.  Using the debugger I can see
> that this new view has all of the right data ... but it has no window!
> What's my next step?
>
> TIA
>     Norm
>
>


0
ajaykalra (6842)
9/2/2003 9:30:49 PM
Dialog-based apps do not have views. What ARE you talking about?
				joe

On Tue, 02 Sep 2003 17:35:32 GMT, "Norm Dresner" <ndrez@att.net> wrote:

>I've created a toolbar button fort he cloning operation and the function it
>calls invokes a constructor for a new view.  Using the debugger I can see
>that this new view has all of the right data ... but it has no window!
>What's my next step?
>
>TIA
>    Norm
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
9/3/2003 2:50:00 AM
Hi Norm,

Thanks for your post. I agree with Ajay's suggestion. In addition, could 
you please post some code snippet which demonstrates what you are doing?

I look forward to hearing from you.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! �C www.microsoft.com/security
This posting is provided ��as is�� with no warranties and confers no rights.

0
timhuang (89)
9/3/2003 6:41:14 AM
I have a class created by the Wizard called CCalcView.

    It's what contains the program's main dialog.

        Norm

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:0mlalvg5utl802pqsl8bnt7kmh1279q4lc@4ax.com...
> Dialog-based apps do not have views. What ARE you talking about?
> joe
>
> On Tue, 02 Sep 2003 17:35:32 GMT, "Norm Dresner" <ndrez@att.net> wrote:
>
> >I've created a toolbar button fort he cloning operation and the function
it
> >calls invokes a constructor for a new view.  Using the debugger I can see
> >that this new view has all of the right data ... but it has no window!
> >What's my next step?
> >
> >TIA
> >    Norm
> >
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


0
ndrez (136)
9/3/2003 9:18:17 PM
The class CCalcView was created by the Wizard to represent the main dialog.

The routine invoked by the toolbar button is this:
void CCalcView::OnButtonClone()
{
CCalcView xx = CCalcView( *this);
}

and the routine that's "CCalcView( *this )" is a copy constructor.

In the debugger I have verified that the copy constructor works and creates
xx with the same data that exists in the then current dialog.  But no window
is created.  What should I be doing?

    Norm


"Tian Min Huang" <timhuang@online.microsoft.com> wrote in message
news:UGZjkZecDHA.460@cpmsftngxa06.phx.gbl...
> Hi Norm,
>
> Thanks for your post. I agree with Ajay's suggestion. In addition, could
> you please post some code snippet which demonstrates what you are doing?
>
> I look forward to hearing from you.
>
> Have a nice day!
>
> Regards,
>
> HuangTM
> Microsoft Online Partner Support
> MCSE/MCSD
>
> Get Secure! �C www.microsoft.com/security
> This posting is provided ��as is�� with no warranties and confers no
rights.
>


0
ndrez (136)
9/3/2003 9:25:21 PM
Norm Dresner wrote:
> 
> The class CCalcView was created by the Wizard to represent the main dialog.
> 
> The routine invoked by the toolbar button is this:
> void CCalcView::OnButtonClone()
> {
> CCalcView xx = CCalcView( *this);
> }
> 
> and the routine that's "CCalcView( *this )" is a copy constructor.
> 
> In the debugger I have verified that the copy constructor works and creates
> xx with the same data that exists in the then current dialog.  But no window
> is created.  What should I be doing?
> 
>     Norm

You have a CCalcView object but no underlying window.  If it is a dialog
then you have to create the dialog window.  For a modal dialog call its
DoModal.  For a modeless dialog call its Create.

--
Scott McPhillips [VC++ MVP]
0
scottmcp (342)
9/3/2003 11:25:43 PM
Hi Norm,

Thanks for your response. I'd like to share the following information with 
you:

Please be noted that we can initialize a class' object in the contructor, 
and a dialog won't be created until we call CDialog::DoModal or 
CDialog::Create. If we create a modeless dialog with CDialog::Create(), we 
should also call CDialog::ShowWindow to explicitly display it.

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! �C www.microsoft.com/security
This posting is provided ��as is�� with no warranties and confers no rights.


0
timhuang (89)
9/4/2003 12:48:51 PM
Reply:

Similar Artilces:

Forms manager dialog box? CAN'T FIND THIS FOLDER
The Outlook forms cache (forms cache: The folder located in C:\Windows\Forms that serves as a storage location for forms.) is corrupt. To repair the forms cache, you need to clear its contents. Open the Forms Manager dialog box. How? On the Tools menu, click Options. Click the Other tab. Under General, click Advanced Options. In the Advanced Options dialog box, under Appearance options, click Custom Forms. In the Custom Forms dialog box, click Manage Forms. In the Forms Manager dialog box, click Set. In the Set Library To, dialog box, under Forms Library, select Personal Forms. Click...

MFC Dialog Font
Consider an MFC app in which all the dialogs use the default font, MS Sans Serif 8. According to the character map, MS Sans Serif does not support Unicode characters. However, if I compile my app as Unicode and put a string containing Unicode characters into a label or control, it displays properly. I would expect it to show mystery characters or ??s. What is going on here? ...

Calc Prorated Cost based on Specific Days in a Given Month & Year Range
Hello Everyone, I beg your assistance. I posted this last year, and reread this recently. I've come to realize how crappily I described this, and thought I'd give it another go. I have the need to take 2 dates, possibly in different years, and calculate Cost totals between them. The tricky part is that the price is annual, but we prorate it to only the days used. We also need to do the calculation on a daily level as the price for service is Monthly, regardless of how many days are in a month. We do however calculate it down to the day. Confused yet? Let me give an example. This is...

Search Results View
Hi, Is there any way to change the view for "search results" in accounts. The problem we have is that we could have several companies with the same name, so ideally we would like to put another column in the "search results" field e.g. city. I have changed the default views for all other accounts but can nto find a way to change the "search results", even looking in the savedquerybase to see if i can find the savedqueryid. Thanks in advance Simon Use this url where your server replaces crm http://crm/tools/viewEditor/viewManager.aspx?id={00000000-000...

Conditionally Converting Text to Numbers in VBA #2
It's ok thanks; solved it me'self on error resume next check = datevalue (cellref) if check > 0 then ' alter the date using datevalue else ' ignore end if on error goto 0 Thanks anyway ;) -- Jon ------------------------------------------------------------------------ Jon's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3178 View this thread: http://www.excelforum.com/showthread.php?threadid=268772 ...

Export/Import Saved View
Hello, Is there a way to export the Saved View from one CRM installation/environment and import it into another? Thank you. ...

worksheet tabs #2
How do you switch between worksheet tabs using the keyboard? Use CTRL+PageUp and CTRL+PageDown. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "llh" <anonymous@discussions.microsoft.com> wrote in message news:988001c3eb38$6ac0ebf0$a301280a@phx.gbl... > How do you switch between worksheet tabs using the > keyboard? In Excel, go to Help and Look at Keyboard Shortcuts "llh" <anonymous@discussions.microsoft.com> wrote in message news:988001c3eb38$6ac0ebf0$a301280a@phx.gbl... : How do you switch bet...

Sentinel System Driver.msi v7.2.2?
I am needing to locate the above driver to updte my RMS Headquarter Dongle. Our current driver seem to have gotten corrupted when management was trying to intergrate great plains on my test server. I can get the key to show up any more. Ed Ed, If USB, try plugging it into a different port. If parallel, shut the machine down, un-plug it and re-start, plug it back in. The drivers are automatically installed in the \Program Files\Rainbow Technologies\Sentinel.. folder -- * Get Secure! - www.microsoft.com/security You must be using Outlook Express or some other type of newsgroup rea...

Ready.....Calculate #2
Followup to the "Ready Calculate" question. I am opening four workbooks. It is only when I open the fourth workbook that the "Calculate" appears. The 'Calculation' tab under Options shows Automatic, not Manual. What have I done to cause it to require Manual? Hi maybe this is a large workbook containing many formulas. In this case Excel switches to manual calculation mode -- Regards Frank Kabel Frankfurt, Germany "William" <anonymous@discussions.microsoft.com> schrieb im Newsbeitrag news:DFB54732-7874-4238-A322-EB37A3237261@microsoft.c...

Possible to hide the All Mail Folders part of Mail view?
I have rules that move messages to folders in my hierarchy. The problem is that the All Mail Folders section of the Nav Pane (when in the Mail view) resizes vertically to show the folder. This hides my Current View part of the Nav Pane that I use frequently. Is there any way to customize the nav bar to remove parts like. IOW, I only want Fav Folders and Current View to display. (I can get to the other folders through the Folder View when I need to) Use the shortcuts button to create the view you want. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion ...

New a view for owned and shared records
I'd like to define an accounts view that shows all accounts I own and any that I'm shared on. I can't find the field with the shared information. Any suggestions? Hi, So basically you want to see all accounts to which you have access. Define criteria for filters, dont mention the owner and you will see all account to which you have read access. Just put one filter. Show me all Active Accounts. -- PLEASE do click on Yes or No button if this post was helpful or not for our feedback. uMar Khan Email for direct contact: imumar at gmail dot com "Ed Crawford" wrote:...

email 2
thanks Ron I have these hickups 1. If i go to Tools> references is deactivated. 2. What do you mean by: Place a Checkmark before Microsoft Outlook ? Object Library ? is the Excel version number. 3. if i run macro sub Mail_ActiveSheet_Body the debugger gives message "user - defined type not defined" please help Hi es Please use the same thread Alt-F11 Select your workbook on the left first Tools>References Search for Microsoft Outlook ? Object Library and check it OK There is also a example on my page for Late Binding (you don't have to use Tools>References ) ...

HELP! with Views
Hi, I am having some challanges and I hope someone can guide me in the right direction. Here is the deal we just recently upgrade from Outlook 97 to 2003. What I am finding is that it's a completely different world. One of the things I noticed is that when I setup my views to only show me any unread messages it does do that, but as soon as I click on the e-mail it doesn't take it off the view. The only way I found to get it to work right is to press the F5 key to refresh. This never happened in the previous version of Outlook. Is there a setting or something I am missing I am re...

View of All Folders
Is there a way to establish a view that displays the contents of all folders in Outlook 2007? No. --=81 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. =20 After furious head scratching, Cindy Mikeworth asked: | Is there a way to establish a view that displays the contents of all | folders in Outlook 2007? ...

Help with a Query Based Distribution List : Some recipients never received a message.
Hi, We had a need to diffuse an email to all the users within our Exchange 2003 Organisation. I created a Query Based Distribution List containing everyone with a mailbox (which means tens of thousands of people..) and we sent the email. The distribution list has been expanded, processed, and messages started appearing in mailboxes a couple of minutes later. My problem is...not all the mailboxes got the message ! It's been 24 hours now and still no news from the message in the remaining mailboxes. I have no clue where these messages got lost : I can't find them in any queue, an...

Setting a view for multiple folders in one step?
Is it possible to select a certain view to several folders at once? How could I easily choose "messages with autopreview" for instance to more than one folder at a time? (Is this impossible?) thanks Sabrina ...

CRecordset and Primary keys #2
I am using an access database with a couple of tables. The problem I have is that I need to insert a row into table A, obtain the new primary key and then insert a new row into table B with the primary key from table A as a foreign key. How do I obtain the primary key to the row I have just inserted into table A???? ...

Outlook (Laptop) Client and .Net 2.0
Hi All, Just a question: Will the Version 3 Outlook Client install with .Net Framework 2.0? Thanks, Nathan Manzi It should be fine. In 3.0, during the Outlook install, it will check for all the requirements and install the ones you don't have. Frank Lee Workopia, Inc. http://www.workopia.com/Links.htm "Nathan Manzi" wrote: > Hi All, > > Just a question: Will the Version 3 Outlook Client install with .Net > Framework 2.0? > > Thanks, > Nathan Manzi ...

Some graphic do not show up while viewing
While I'm working on my newsletter some of my graphics do not show up. The picture box is there but it only shows up when I go to print preview. This makes it hard to edit not being able to see the graphic. Any suggestions? View, pictures, detailed display -- Mary Sauer MS MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "barryll" <barryll@comcast.net> wrote in message news:O7pgDO1FFHA.1260@TK2MSFTNGP12.phx.gbl... > While I'm working on my newsletter some of my graphics do not show up. The picture > box is there but it...

Customizing Outlook 2003 #2
I just received Outlook 2003 with my new computer. I can't say I like the interface very much -- too much junk on the screen. Is there a "skin" or some other thing I can get to make it look more like the old Outlook -- flatter colors, etc.? Thanks. -- ------------------------------------------ Jeffrey Needle jeff.needle@gmail.com "too much junk on the screen" maybe you have too many things open - just a folder list on the left and outlook today on the right looks fairly minimal - if your in XP you may want to go back to the 'XP Classic' theme? O ...

Cloning Austin Powers (with modifications)
Hi, Does anyone know how to do the following, for example, please? Cell A1 shows: Austin Powers, International Man of Mystery. However I'd like cell A2 to copy the information, but delete everything from the comma onwards automatically. So cell A2 should show: Austin Powers Thanks for your help, Dan. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ Dan, Try the following formula. It works regardless of whether a comma exists in A1. =IF(ISERROR(FIND(",&...

VLOOKUP function part 2...
Apologies for the repeat thread, just there is so much traffic here that the last part of my query went without an answer. Sheet "Employee Data" holds usernames of about 1500 employees in the format "joe.bloggs" in column A and employee payroll numbers in the format 00001, 00002, etc in column B I am looking for a formula so that in another worksheet, where an employee types a name in the format "Joe", "Bloggs", "joe.bloggs" or Joe Bloggs" in the cell in column C, it will return the relevant payroll number in column D. If t...

How clone a view
Hi, can anybody tell me, how can I clone a view with dmo or TSQL? Thanks What do you mean by "clone" a view? You want to create an exact copy of the view somewhere? If so, on the SQL side you might start by querying INFORMATION_SCHEMA.VIEWS. There's a column called VIEW_DEFINITION that has the exact DDL CREATE VIEW statement in it. "Thomas Hase" <tohasremspam@freenet.de> wrote in message news:gi8pk594sfo314dr49t3r0tjitfno15nhr@4ax.com... > Hi, > > can anybody tell me, how can I clone a view > with dmo or TSQL? > > Tha...

get view from doc/another view #2
How do I get a view from a document? or get a view from another view which is sharing the same document? I am working on a MDI application, and I have two views sharing the same document. I want to be able to click on a button of one view and get some information about the other view, but I don't know how to get the pointer to that. Thanks, Apple I'm running into a strange problem with my MFC based UI application. I'm using MS DevStudio.net 2003 on Win-XP. Occasionally my app just hangs & there is no know way of reproducing the problem. I used WinDBG to find out the line o...

Multiple people able to view as "My Contact"?
We have many shared contacts within our organization, and a tremendous amount of Active contacts for users to sift through when looking for a shared contact. Is it possible to have multiple users view the same contacts in the "My Contacts" view? Thank you in advance. S Carroll You sound like you need a way to categorize contacts for teams or group... If so, I'd start by adding a picklist field and then creating custom views based on thse fields. For example, the Northwest Team only sees contacts with the new field "northwest" chosen. Alternately, you could redu...