VS2003 - How do I add a variable to a specific class created from a dialog resource?

Hello,

I have a dialog resource and have created  CDialog and a CFormView classes 
for this dialog.

If I right-click a control in my dialog I can create a variable for the 
control, but how do I specify which class the variable belongs to, ie. my 
CDialog or CFormView class?

I don't see how I can tell the add variable class wizard to which class the 
variable should be added.

I'm converting a Dialog based app to a doc-view type app and am 
experimenting with CFormView, which is why I have CFormView and CDialog 
classes referencing the same dialog resource.

Thanks for any help.

-Randy 


0
RJGraham
10/17/2004 11:58:23 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
557 Views

Similar Articles

[PageSpeed] 55

>>
>> If I right-click a control in my dialog I can create a variable for the 
>> control, but how do I specify which class the variable belongs to, ie. my 
>> CDialog or CFormView class?
>>
>> I don't see how I can tell the add variable class wizard to which class 
>> the variable should be added.
>>
>
> If you click on a control in your dialog the variable will be created in 
> your dialog class.  What else would you expect?

Well, I would expect a way to select which class to add my variable to.


>
> The wizard has no provision for two classes using the same dialog 
> template.  If you gotta do this then a little copy and paste will get it 
> done without the wizard.  Make sure you copy the DDX_Control line - that's 
> the key thing the wizard does to create a control variable.
>

I figured as such.
Thanks for your help, I just wanted to know if I was missing something.

-Randy


0
RJGraham
10/18/2004 2:08:04 AM
RJGraham wrote:

> Hello,
> 
> I have a dialog resource and have created  CDialog and a CFormView classes 
> for this dialog.
> 
> If I right-click a control in my dialog I can create a variable for the 
> control, but how do I specify which class the variable belongs to, ie. my 
> CDialog or CFormView class?
> 
> I don't see how I can tell the add variable class wizard to which class the 
> variable should be added.
> 
> I'm converting a Dialog based app to a doc-view type app and am 
> experimenting with CFormView, which is why I have CFormView and CDialog 
> classes referencing the same dialog resource.
> 
> Thanks for any help.
> 
> -Randy 
> 
> 

If you click on a control in your dialog the variable will be created in 
your dialog class.  What else would you expect?

The wizard has no provision for two classes using the same dialog 
template.  If you gotta do this then a little copy and paste will get it 
done without the wizard.  Make sure you copy the DDX_Control line - 
that's the key thing the wizard does to create a control variable.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
10/18/2004 2:35:02 AM
Reply:

Similar Artilces:

Add a new code macro
I have workbook that I am trying to use with a macro form another post on this form. It inserts a new row with the formulas and contents of the selected row. The problem is that it copies the row below the one selected, and because of this, I can not make a copy of row 2 below the column headers. Any ideas? Thanks. Here is the code: '/=======Start of Code==========================/ Sub InsertRowsAndFillFormulas() 'adds desired # of lines below the current line and ' copies the formulas to that/those lines 'added selection of more than one worksheet ' - Gary L. Brown &#...

creating a formula.
Hi folks, I am trying to create a formula that will: if a1:a4= to either values 1,2,4 and 12 where value #1 is "Annua Leave" value 2 is "Sick Leave", value 4 is " Comp. Time", value 12 i "Leave Without Pay" respectively then the answer should be inputted i columns b1:b4 respectively. Can anyone help me create this formula ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com I'm not sure I understand your question, but here's a ...

I can add an extra calendar, but can't share it??
At my workplace we have a dozen of calendars for the rooms we use, like: - Meeting room1 - Meeting room2 - Jobcar1 - Jobcar2 and so on. Now we have calendar-books for each of them, and every time I want to reserve a room or the car I have to walk at least 50 meters... I thought it would have been nice if we could use Outlook calendar for this, I have now added a calendar, but it's not possible for anybody else to open it..? why? Are there better ways of doing this? (I know there are web-calendars and so on, but outlook would be much more convenient).. Best regards, =D8ystein In ne...

Using XSD stored in assembly resource with includes
I am trying to validate an XML file against an XSD that is stored in the assembly as an embedded resource. I can get it to work as long as the XSD does not include other XSDs. After a fair amount of searching, I have found 3 possible solutions but none have worked for me. They are: 1. Use the Includes property of XmlSchema to add included XSDs, then call Compile XmlSchema mainSchema = XmlSchema.Read( stream1, null ); XmlSchema includeSchema1 = XmlSchema.Read( stream2, null ); XmlSchema includeSchema2 = XmlSchema.Read( stream3, null ); mainSchema.Includes.Add( includeSchema1 ...

Creating Templates, Need Advice
What is the best way to setup a template? I am building a PPT file and want to preserve test look and feel and custom animations as well as image custom animations, background and other miscellaneous graphic/page layout lements. In brief I want to let people insert their own text and images but preserve the properties of the text or image box. Dont think slide master is the answer, perhaps there is another way? Thanks for reading and offering advice, bmgid What version of PPT are you working with? -- Troy @ TLC MS PowerPoint MVP Check out www.ThePowerPointBlog.com ...

Hide the Help button from Propertysheet dialog
Hello, Could you tell me, how can I hide the Help button from Propertysheet dialog in the wizard mode? I want to appeare just Back, Next, Cancel and Finish button in the dialog. I don't need to the Help button. By the way, PropertySheet.m_psh.dwFlags &= ~PSH_HASHELP; doesn't work. Thank you so much, Monica. Hello Monica, > By the way, PropertySheet.m_psh.dwFlags &= ~PSH_HASHELP; doesn't work. This should work. You need to remove it from each of the property pages as well. Here is the link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccor...

Urgent!Need help with creating a Christmas PowerPoint slideshow
I'm creating a Christmas PowerPoint slide show of my family,can someone tell me where I can download free Christmas templates for my presentation? And I want to put this PowerPoint slideshow on Youtube to share with all my relatives and friends. I tried to upload an.PPT file to Youtube but failed, any idea? Thanks Dwight, There are some templates on office online: http://office.microsoft.com/en-us/templates/results.aspx?qu=CHRISTMAS&sc=4&av=ZPP -- Luc Sanders MVP - PowerPoint "Dwight" <Dwight@discussions.microsoft.com> schreef in bericht new...

how to disable local resources from EPM 2007?
Hi. Is there any way to disable local resources of EPM? Thanks for help. Macedo -- No, there is no way for the Project Server administrator to disable the use of local resources in enterprise projects. So, if you do not want your PMs to use local resources, you need to make this a training and performance issue with them. Hope this helps. -- Dale A. Howard [MVP] VP of Educational Services msProjectExperts http://www.msprojectexperts.com http://www.projectserverexperts.com "We write the books on Project Server" "Macedo" <rcmacedo@gmail.co...

undefined variable in form
Hi, when opening the form 'product' to create a new product, the script error appears in IE: Line: 137 Char:9 Error:'quantitydecimal' is undefined Code:0 URL:http://<pc>.<domain>.de/Products/Product/edit.aspx The values in the field 'supported dezimals' are stored correctly in Database after saving the new product. How can I solve this problem ? Thanks Sounds like someone made a change to the form and removed the Quantity field. Put it back on the page and this should go away. Matt Parks MVP - Microsoft CRM ------------------------------------...

Modeless Dialog from MFC Regular DLL opened from EXE problems
Hi, Resources for the MFC modeless dialog are in a Regular DLL with MFC statically linked, No message overrides are set with the dialog, it is a generic dialog with only the OK and Cancel buttons. I choose a MFC AppWizard(exe) Dialog based for the calling EXE and used Run-Time Dynamic Linking to the DLL. Tried a couple I different approaches base on what I found on the newsgroup and the usual help sites. I know that I need to keep the modeless dialog from going out of scope after it is created so this is what I tried two different methods so far but I still can't get the dialog to hang ar...

I want to add new Tab for all the entity even for custom entity
Hi, I have requirement to add new Tab for all the entity even for custom Entity. In EntityName > Details > Information there are 4 tabs - General, Details, Administration, Notes. How do I add another tab over there? Regards, Chittu Hi, You need to open each entity’s form and then add new tab. There is no one step to get it effected on all entities. Settings -> Customization -> Customize entity -> Account -> forms and Views -> Account Form -> Add Tab -- PLEASE do click on Yes or No button if this post is helpful or not for our feedback. uMar Khan :: CRM Freel...

1D, 2D, 3D, 4D and ND interpolation Excel Add-in (xll)
Hi, You can find here http://xongrid.sourceforge.net/ A new interpolation xll add-in for 1D, 2D, 3D, 4D or ND interpolation on scattered data ...

how do i create an office data connection file
i want to call a parameterized data connection. i want to eventually put this in office sharepoint server 2007's data connection library. every time i open the connection file i have successfully created that connects to the db, it want me to pick a table. i can cancel out of that and change it to sql and say to use a procedure, but i can't save this file, and the "Edit Query..." and "Parameters..." buttons are disabled so i can't set parameters. why is it so hard to work with this thing? thanks ...

Resource Units
I want to be able to have a resource, say 'electrician', with 5 available for the day shift and 2 available for the night shift. This would allow e to just assign the 'electrician' resource and have project level based on unit availability. If I setup 'electrician Day' and 'electrician Night', then I need to carefully select which to use and if the schedule shifts it is a nightmare. Any thought on how to do this? Thank-you! On Jan 6, 10:43=A0pm, John K <John K...@discussions.microsoft.com> wrote: > I want to be able to have a resou...

inherits class.
Hello. I want to create a new class (VB 2008). What I did : add new class. and wrote : Public Class MenuButton Inherits Panel .... The code isn't compiled : Error 1 Base class 'System.Windows.Forms.Panel' specified for class 'MenuButton' cannot be different from the base class 'System.Windows.Forms.UserControl' of one of its other partial types. I need little sample code, so I can go on ..., please. Thanks :) Am 19.03.2010 11:54, schrieb Mr. X.: > Hello. > I want to create a new class (VB 2008). > > What I did : ...

how to create formula to divide two rows autoaatically
Is there any way to setup a sheet or create a formula so that it will divide the data in column A by Column B anytime the data is entered and put it into columnC ? What I am trying to do is create a spreadsheet for calculating fuel MPG. So I have columns as miles, gallons and the calculation as MPG. What I want to do is anytime a value is entered into miles and gallons, to calculate mpg and put it into that respective cell. Is there any way I can do this ? Thanks -- Tony Tony, in Column C, type the formula =sum(a1/b1). This should give you the result you are looking for. Hop...

Quit creating duplicate desktop icons when doing upgrades/hotfix #2
Upon any sort of upgrade or hotfix, RMS creates a whole new set of desktop icons. What a pain! Pls fix. Ask if we want to create new desktop icons, pls. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/...

HQ creating duplicate POs after 340
Sometimes - not every time, and not on command - I end up with duplicate POs in my Store Operations database after issuing a single WS340 from HQ. When I look at the worksheet history in HQ, is shows that it was processed successfully * twice * at the exact same time. UPDATE - problem solved. Somehow one of the 'manual connection only' office PCs got the 'manual connection only' unchecked. I'm going to post this anyways - just in case someone has a similar problem in the future. Tom ...

Edit specific range in protected worksheet
Dear Sir/Mam, I have a workbook with multiple worksheets. I protected a sheet but some menu does not work when it is protectd. e.g. i want to go edit > fill > series. How it can be possible. Thanks in advance Rao Ratan Singh If it's protected, you simply can't. You'd have to unprotect it first. Or write a VBA procedure to unprotect, do the fill series, reprotect. Bob Umlas Excel MVP "Rao Ratan Singh" <RaoRatanSingh@discussions.microsoft.com> wrote in message news:FF6C347C-1BEE-40D3-ADE1-E617A7033F0D@microsoft.com... > Dear Sir/Mam, > I have a w...

Test variable range for 'Delete'; then delete the row
I’m getting a run-time error 1004 here. Application defined or object defined error. The error seems to occur here: For Each c In Application.Intersect(ActiveSheet.UsedRange, ActiveSheet.Range("O12:O" & rngFound)) Private Sub CommandButton4_Click() Dim c As Range Dim rDelete As Range Dim rngFound As Range Dim rngToSearch As Range With Range("A:A") Set rngToSearch = Sheets("Worksheet").Columns("A") Set rngFound = rngToSearch.Find(What:="Enter non-listed privately held securities or groups of assets by asset class.", _ ...

Creating a CDialog derived class for a Dialog??
I am trying to convert a project from Win32 to MFC. I created a new dialog resource, but when I try to do the right-click add class thing from the dialog editor, it doesn't do anything. I am using VS.NET 2003 Pro. In the dialog that pops up to create the new class, I change it to derive from CDialog, it already has the ID for my dialogbox resource selected, and I enter a new class name, and it generates the .h and .cpp names. I click Finish and NOTHING happens. I try it again from the main menu, but this time it pops an error box saying "Object Required". I am stumpe...

Resizing dialogs
Hi. I have an MFC dialog based app. I want the user to be able to resize the dialog horizontally only. How can I do this? I have tried changing the onsize(...) function without success. The is a very important feature for my application. Please help. Thanks, Blair Blair wrote: >Hi. I have an MFC dialog based app. I want the user to be able to resize the >dialog horizontally only. How can I do this? I have tried changing the >onsize(...) function without success. The WM_SIZE message informs you of a size change that's already occurred, so it comes too late to help. >The is...

Linking a Combo box to variable SQL query in subform
I am in the process of creating a relatively small D'Base that will monitor employee competency. There are several tables and relationships within this, but I don't consider this to be a big project (although my first post-graduation in the real world). I have configured the records to be spread over two tables. One is the tbl_ReviewHearder (containing employee info', review date), the second, tbl_ReviewContent contains the competency information. This is based on a 1-many relationship (1 header, lots of content) I have written VB to filter the combo boxes, but I am having ...

can add multiple analysis code in a single FRx Row format
Currently we can add several analysis code in FRx Row format by using several rows (each row will contain only 1 analysis code - limitation of FRx with MDA). The client has many analysis codes in each analysis group. What they need is to add some of the analysis code in a single row; separating it into several rows will add more work in designing the FRx report. There should be a way for next releases of FRx to handle adding mulitple analysis codes in a single row or column of the report. ...

change all controllers' font in a dialog
Env: WindowsXP, VC+6.00 There are any easy ways to change all controllers' font in a dialog(NOT one by one)? TIA William If you mean to change font for the controls in a dialog, you can enumerate over all the children of the dialog and call SetFont on each of them(Use EnumChildWindows). Another option is to use SendMessageToDescendants. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "William" <port@mx15.freecom.ne.jp> wrote in message news:u0W39WplHHA.4848@TK2MSFTNGP05.phx.gbl... > Env: WindowsXP, VC+6.00 > > There are any easy ways to change all contro...