Custom base class for dialog - inheritance problems

I have a base class derived from CDialog, let's call it CMyDialog.
CMyDialog implements basic functionality that a large group of my
dialogs need to have. One common member is a CGridCtrl (another derived
class), that implements subitem editing.

My issue comes to having handlers that respond to LVN_BEGINLABELEDIT as
well as LVN_ENDLABELEDIT. To use the message map functionality I need
to have some identifier such as IDC_LIST1. The problem of course is
that CMyDialog doesn't have access to this value. The other problem is
that perhaps the CGridCtrl members doesn't have the same dialog
identifier in all instances of the dialog.

Right now I can add handlers in each CMyDialog derived class that
basically just called the parent class. I'd like for this to be
transparent in the implementation of CMyDialog though.

Anjo

0
anjogasa (7)
11/7/2005 6:58:37 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
444 Views

Similar Articles

[PageSpeed] 57

If I understand your issue correctly, you could use message relfection
and catch these notifications in the control itself rather than letting
the dialog handle it.

-------------
Ajay Kalra
ajaykalra@yahoo.com

anjogasa@gmail.com wrote:
> I have a base class derived from CDialog, let's call it CMyDialog.
> CMyDialog implements basic functionality that a large group of my
> dialogs need to have. One common member is a CGridCtrl (another derived
> class), that implements subitem editing.
>
> My issue comes to having handlers that respond to LVN_BEGINLABELEDIT as
> well as LVN_ENDLABELEDIT. To use the message map functionality I need
> to have some identifier such as IDC_LIST1. The problem of course is
> that CMyDialog doesn't have access to this value. The other problem is
> that perhaps the CGridCtrl members doesn't have the same dialog
> identifier in all instances of the dialog.
>
> Right now I can add handlers in each CMyDialog derived class that
> basically just called the parent class. I'd like for this to be
> transparent in the implementation of CMyDialog though.
> 
> Anjo

0
ajaykalra (6841)
11/7/2005 7:22:29 PM
One possible solution, which I just implemented after reading your
message. Unfortunately what if CMyDialog has the need to access control
variables using identifiers, and I want this behavior to pass to
derived classes. Is there a better solution that will allow me to use
inheritance CMyDialog?

Anjo

0
anjogasa (7)
11/7/2005 7:38:30 PM
I am not entirely sure why that is a problem. You can always use
GetDlgItem if all want is a CWnd based on ID.

--------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6841)
11/7/2005 7:46:39 PM
Reply:

Similar Artilces:

Custom Entity Relationship CRM 3.0
I have created a new custom entity (A) for which I need to create two referential relationships to other custom entities (B) & (C). (A) is the primary entity in both cases. The relationship between (A) and (B) acts normally. The relationship between (A) and (C) doesn't. When I try to add a (C) record from (A), (A) displays two records in the (C) lookup. One "record" displays data from system fields (created on and status). The second "record" displys data from the primary field. I am not able to access (C) record from the associated view in (A), but I can a...

date track based on svc cond.
Hello, I'm looking to track material out for repair by the type of service requested. In cell (G:2) will be the type of service: BCK = bench check = this will have a projected return date (I:2)within three days of the repair order date (H:2) REP = repaired = This will have a projected return date (I:2) within 7 days of the repair order date (H:2) OVH = overhaule = this will have a projected return date (I:2) within 14 days of the repair order date. With all this I would also like to include the warranty schedule from the date of the service reurn date(J2) BCK= no warranty REP= 90...

Custom toolbar and macros
I am moving a user from Windows 2000 to XP and he has a worksheet with many custom Macros as well as the custon toolbar with it. We can move the worksheet and the macros will move with it. The problem is moving the custom toolbar with it. How do I get the toolbar to move along with the worksheet. One way: With the custom workbook active, choose Tools/Customize/Toolbars. Click Attach. Attach your custom toolbar to the workbook. In article <F0FC2885-07CB-4706-BC67-DEB7B664BACF@microsoft.com>, "MD" <MD@discussions.microsoft.com> wrote: > I am moving a user fro...

Under 10.6 -- problems opening files with "#" in the name
Hey all.. A user showed me this one and I could replicate it on my computer as well. If an Excel 04 file has a "#" in it's name -- under 10.6, if you double-click on the file, Excel 04 will launch, but not open the file. File --> Open works, though. However, if you remove the "#" from the name of the file (say the original is "123#.xls" and the change is to "123.xls" -- then the file will open via double-click. This appears to be new behavior under 10.6. The user had no problems with the #-in-the-name files under 10.5.8. I also tried t...

Macro
Hi, I have this database from column C to T and row 4 onwards. What I hope to achieve is to copy the entire row from C to T to another sheet (similarly from Column C to T and row 4 onwards) if the cell for that row in Column L is "Lost Case". At the same time, the selected rows to be copied in the original sheet should be deleted after being copied. Another consideration is that new data will be added to the original sheet from time to time and thus the database might expand or shrink (after being copied and delete, and the addition or new data). Thus, when the macr...

Statements: Numbering and then being able to apply based on state
Have a client who can have 20,000 invoices for a customer in a month. The customer only gets a statement. Would like to be able to number statements and then if the customer pays the full amount be able to pay based on the statement number. Thought about using lockbox processing to try and set up a format based on the electronic data that comes back with the check as well. But need to find if anyone has a solution for the statement numbering We created a customization for a customer about 5-6 years ago that does something like this...it was pretty involved. From what I recall, ther...

toolbar customization
533 MHz Power PC G4 384 MB SDRAM MAC OS X 10.3.3=20 Office X: Excel 10.1.5 (Service Release 1) When I drag command buttons to Excel's Standard Toolbar I get grayed-out = icons as follows: Hide Detail Show Detail Insert Rows Ironically the following buttons, dragged in precisely the same = fashionto the=20 Standard Toolbar, work satisfactorily: Insert Columns Delete Column Delete Row Any suggestions? Has MS discoveed and repaired these bugs for the May=20 2004 updates? While they're not bugs, they are confusing. You probably dragged the Insert Rows button from the Edit categ...

CRM Customization: Display Contact Info on Service Activity Form
We'd like to be able to open a service activity, and display all of the associated contacts' information (name, phone, address) on the same form. We have attempted to use IFRAMEs to load this information, but have so far been unsuccessful in achieving the desired effect. What is the best approach to take here? I am trying to do the same... What I really want is: 1) Service activity calendar view to show the customer name, number and address in the mouseover 2) When a service calendar item is clicked on, I would like the contact name, address and telephone listed in the main fo...

XSD.exe handling of mixed content types in generate classes?
I'm trying to generate class definitions from an XSD that contains something like: <xs:complexType name="foo" mixed="true"> <xs:choice minOccurs = "0" maxOccurs="unbounded"> <xs:element name = "bar" type = "something"/> ... <xs:element name = "baz" type = "somethingelse"/> </xs:choice> </xs:complexType> The C# code generated by XSD.exe creates a class that has an array of objects to allow for an arbitrary number of elements (reflecting the ...

Problems connecting after changing a username
I'm having an issue with a user account. On our Exchange server we have POP3 server running. I set up an user account and tested the settings for the POP3 account. Everything tested fine. I was informed by HR that there was a misspelling in the user's name, so I corrected it, but now when I try to connect to the POP3 server I get an error that says the username, password or e-mail address is incorrect. I can't help but feel this is related to the username change, but I'm not sure how to correct it. Can anyone help? -Michael Kun ...

Tracking customer orders when receiving stock
With our current POS system we can place items on order for a particular customer (whether we are holding the stock or not) and when we generate purchase orders the system automatically pops up letting us know we have pending orders for customers. We can then generate a purchase order based on this information. When we receive the stock, we can print out a report for that order that lists what stock needs to be allocated to which customers. Is there a way with RMS that we can do this? Unfortunately it is a regular occurance that our stock levels can be incorrect, for instance we may have a 0 ...

RUS problem #2
Hi, I've got a problem with creating multiple distribution lists at once. I create the lists using "Users and Computers" and start mailenabling them using the exchange assistant. After mailenabling I start RUS to provide eMail addresses to them. Further on I start the OAL generator to publish them to the organization. Everything works without any failure. When I open the new created distr. lists using the address book of Outlook and open the properties of the lists I was wondering. Although all settings in AD are correct all distribution lists have got the same conent in ...

weird CFileDialog / GetOpenFileName problem
I'm having two weird problems with CFileDialog and/or GetOpenFileName that QA is on my back to fix :). 1) Bring up a normal CFileDialog or GetOpenFileName dialog on Windows XP. Go to the filename field and leave it blank. Hold down the enter key and you will see the "Look in" label, the "Look in" combobox, the "File name" label, the "Files of type" label, the "File name" combo box, and the "Open" button all flash like crazy ** I found a fix for this bug, just reporting it ** 2) Bring up a normal CFileDialog or GetOpenFileName ...

Customize Does not WOrk
When I clip the customize outlook today button, it does not respond. Anyone have an idea of what the problem might be? Posted several times a day here: OL2000: You Cannot Customize Outlook Today After You Install Critical Update 813489 for Internet Explorer: http://support.microsoft.com/default.aspx?scid=kb;EN-US;820575 -- Russ Valentine [MVP-Outlook] "Glenn" <anonymous@discussions.microsoft.com> wrote in message news:05cb01c3cc7b$467a26c0$a101280a@phx.gbl... > When I clip the customize outlook today button, it does > not respond. Anyone have an idea of what the pr...

MS Money 2002 sign-in problem
All of the sudden I seem to have trouble signing into my Microsoft Money 2002 account. When I fire up the program and enter my password I get this message: “Money is unable to verify your Online sign-in….” I have a Windows XP Pentium 4 computer with no recent changes. Here is what I have tried so far with no success: 1. Verified that I can get into my msn.com account; that my password works, etc. 2. Did a system restore on my PC back to when I last successfully got into Money 3. Registered the Msxml3.dll file 4. Did both a “level 1 and level 2 standard repair” of my Money file Any a...

Deleting specific records based on query results
Is there a way to use a select query to find and then delete specific records in a database. My database records basic applicant information in one table (tblApplicants) and any interview data in another (TblActivities). I need to do an annual purge of applicants from a previous year who were never interviewed. I have a select query that returns the name and date entered from the TblApplicants table where the requisition data in the TblActivities table is null. I know I can then go to the TblApplicants and manually delete each record, but at over 1700 records that seems a lit...

How to display HTML in Custom Task Pane
Does anyone know if it is possible to program a custom task pane in Office 2007 (using VSTO) to display hosted web content (i.e. HTML). How about locally stored HTML? My team is looking at ways of providing modest on-screen assistance to support our custom Add-in that docks nicely within the application and can be coupled with a few controls. If it's not possible, we're stuck using CHM. Thanks in advance. ...

XY Scatter with Custom Labels
I have a list of products, each with an X (a dollar amount) and a value (a percentage). Is it possible to have each point labeled with custom value i.e.: Printer, or Digital Camera, rather than it bein labeled with just the values being plotted ($1,000, 2% or $500, 7%)? Any ideas are appreciated. Thanks, Keit -- hatzipe ----------------------------------------------------------------------- hatzipet's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2789 View this thread: http://www.excelforum.com/showthread.php?threadid=47392 You can edit the text of a labe...

Outlook 2002 Problem #5
When I paste text to the body of a email message using Outlook 2002, Windows XP laptop, I get: Microsoft Outlook has encountered a problem and needs to close. Error Signature: AppName:outlook.exe AppVer: 10.0.4024.0 ModName: mshtml.dll ModVer: 6.0.2800.1141 ...

Change dates to a custom format via formula ... how to?
Hello, A2 has formula =NOW() which makes date today in this format: Tue.Apr.26.2011 How can I get my custom date formats so that the above date shows up as Tu.Apr.26.2011. In another sheet, I was kindly given this to make these types of changes: =IF($A$2<>"",TEXT($A$2,"yymmdd.")&CHOOSE(WEEKDAY($A$2),"Sn","Mn","Tu","Wd","Th","Fr","Sa"),"") I tried this, =NOW()&CHOOSE(WEEKDAY($A$2),"Sn","Mn","Tu","Wd","Th","Fr","Sa&...

How to Customize Business Portal to show custom objects?
Hi, I need to Customize Business Portal to show my custom objects in "Primary Publishing List ResultViewer Web Part","Rich List ResultViewer Web Part","Form ResultViewer Web Part"? I need to create pages similar to Customer Summary page in sales center with my custom objects. How can i do that? Thanks, Mohan ...

Outlook E-Mail Encryption Problem
Outlook (2002) refuses to encrypt an e-mail message to a client who uses Lotus Notes R5 in Win 2000, even though in the client's Internet Explorer: Tools/Internet Options/Content/Certificates dialog, both her certificate (on the Personal Tab) and our certificate (on the Other People Tab) are present and have the correct serial numbers. On our system, Outlook will send her messages "signed" but will not allow encryption. (We have exchanged keys with her and are using her public key in Outlook). Something in Outlook is preventing encryption ... does anybody know what that might ...

Customer Report
Hello, I am hoping someone might assist me with a problem. I am trying to customize a customer report to show the Notes from the customer file. It has been suggested to me to run a query on this to pull the info I want. This is great, but not ideally what I am looking for. I want anyone in the office to be able to run the report and filter it to their specifications. For example: we have an anual catalogue and we do not send it to everyone on our mailing list. We want to send it to local customers who have spent money with us or who specifically request a catalogue. We have used up all ...

Outlook/Exchange problem #2
Two users out of about 60 having problems accessing their mailbox using Outlook. One of the users had their mailbox moved from one store to another on the same server, the other user had no changes made. They can both access their Inbox, but not any of the subfolders, or Deleted, Sent, Contacts, Calendar, etc. OWA seems to work fine for both users in all folders. I already tried recreating the mail profile, didn't help. Also tried accessing the mailbox from another client, same problem. One of two things happen... Either Outlook shuts down generating the following: Event 1000 - Fau...

change local customer to global customer
I am trying to change the local customers that i have in my store database to global customers in hq I ran this querie in store administrator UPDATE Customer SET GlobalCustomer = 1 Then ran worksheet 401 in hq, but the customers did not update, then worksheet 350. Can someone help? Had the same issue ... this worked for me - need to set globalcustomer = 1; need to set lastupdated = getdate(*); need to set storeid = 'xxxx' (whatever is appropriate for you). Go into SO Manager and configure ENABLE GLOBAL CUSTOMERS and NEW CUSTOMERS DEFAULT AS GLOBAL. Need to run 401 TWICE (once...