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
718 Views

Similar Articles

[PageSpeed] 25

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 (6842)
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 (6842)
11/7/2005 7:46:39 PM
Reply:

Similar Artilces:

Here is fix for Windows file problems
If you have installed a Windows update and started having problems opening, closing, copying files, see: http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.excel.misc&mid=1fe358b1-c8eb-4217-ad2a-4b9fcf741916 A better solution is offered at http://support.microsoft.com/kb/918165 "Problems in Windows Explorer or the Windows shell after you install security update MS06-015". Patricia Shannon wrote: > If you have installed a Windows update and started having problems opening, > closing, copying files, see: > > http://ww...

Problem with CFTPConnection
Hi I've an application that connects to an FTP Server and uploads a big directory (size over 500 MB). Now what happens is that after sometime the application stops uploading files and stays idle. The FTP server connection timeout value is set to 2 minutes. So the server seeing the connection idle for two seconds, disconnect the session and no more file is uploaded. On debugging I found out that after some time CFTPConnection.PutFile() method hangs on some random file and stays like that for 5 minutes (default send timeout value of CFTPSession). During this time the server connection timeo...

Excel 97 Win XP calc problem?
I have a machine running office 97 and Win XP. I have seen posts stating it runs fine, but I don't know how man people use spreadsheets that require a hard calculation: Excel will not force a calculation. i.e. ctrl-alt-f9 does not cause full workbook calculation as required. Meaning cells do not update and it doesn't calculate unless you clic in the cell to edit and hit enter. neither does the "Calc Now" button. Auto or manual calculation mode has no effect. Anybody else have this problem -- Message posted from http://www.ExcelForum.com Make sure that both the SR1 a...

CRM Outlook Client Configuration Wizard Problem
CRM 4.0 - Microsoft Outlook Client Guys, We've Microsoft CRM 4.0 Server roll up 8 as well as CRM Outlook Client on the same roll up version. Our Internal Web Access works without problems users get to it and they're automatically authenticated. IFD Development is the same way except they're prompt through a login page for their username and password when they're coming from an external network. Ever since we moved to a new facility users are experiencing problems connecting to CRM using their outlook client, I have a test machine where I have the CRM Outlook Client ins...

"Customize Outlook Today" does not respond
The "Customize Outlook Today" button no longer functions. I use Outlook 2000 on two separate computers. the Customize feature works on neither one. They both formerly functioned perfectly. I have noted a few other postings with the same issue, but there have been no responses. Is it possible that one of the updates to Outlook 2000 has rendered this feature inoperable? Since I keep my programs up to date, that is the only guess I have. I have the exact same problem on more than one pc. I have been searching for an answer all day. I just decided to start using the opti...

Problem with Update function of CRecordSet class
Hi All When I use from Update function of CRecordSet class, it apply to table after a few time(for example 1 second) when I need to see it at time. Thanks ...

xsd:extension not inherit attributes?
Does anyone know why if I create a complexType based off another complexType using xsd:extension the attributes don't seem to be inherited? Is this a bug/non-implementation in the .NET Schema editor and the XML validator? Thanks, Mike Jansen Attributes are always inherited from the base type. Can you provide your schema? -- Stan Kitsis Program Manager, XML Technologies Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. "Mike Jansen" <mjansen_nntp@mail.com> wrote in message news:%23BgsAYsNFHA.3492@TK2MSFTN...

Mem leak when implement Singleton pattern on CWinApp derived class
Coded my MFC app to have singleton pattern, my code looks like this: class CMyApp : public CWinApp { private: // static obj static CMyApp* MyAppInstance; // some other obj composed in this class COtherObj* obj; // private cons, I init the COtherObj here CMyApp() { obj = new COtherObj(); } public: // only way to access cons static CMyApp* GetInstance() { //check if already instantiated if( MyAppInstance == NULL) { MyAppInstance = new CMyApp(); } return MyAppInstance; } virtual int ExitInstance() { // I use ExitInstance to delete all ...

Why ClassWiard can't see my Class?
I created a class(Class-A), derived a class(Class-B) which derived from CWnd class. When I used mouse right-click on the new-created class, it shows a popup-command-menu which missing "add virtual function" and "add windows message handler". From ClassWizard I couldn't see the new-created class either. I tried to delete myprogram.clw & re-issue ClassWizard, but it doesn't help. Anyone can help ? Thanks, Eagle "EagleChen" <xx@xx> wrote in message news:uRGde941DHA.3496@TK2MSFTNGP11.phx.gbl... > I created a class(Class-A), derived a class(C...

Problem with macro assigned to custom toolbar button
Problem with macro assigned to custom toolbar button I am having a probelm with macros assigned to a custom button on custom button. I am using excel 2000. 1. I have created a macro called "Jump" in a workbook named "Test1" 2. I then created a custom toolbar and added a custom toolbar button t that toolbar. 3. Through the customize dialog box I assign the Macro "Jump" to th custom button. Everything works fine UNTIL. If I do a SAVE AS for the workbook "Test1" and call it something els like "Test2" and then close "Test2" an...

request to solve my problem #5
hello friends this is vijay,i got a problem while doing my project based on vc++ (i.e)"How to implement Fit Window feature in VC++6.0 in an MDI Application" if any of you got any idea about that please do reply me with the proceedure.i will be waiting for your reply bye with regards vijayprasadreddy ...

OL2002 Problem : HELP, SOS, MAYDAY
Hi, I have an IMAP account and OL2002 as client. I have checked for my account ( tools, send/receive settings, define send/receive groups, <my_account>, edit) download item description only. It works only the first time I start OL2002, but it does not work anymore for subsequent automatic/manual send/receive operations. Please could someone really help me ? Thank you in advance, Patrick ...

Excel. I am having a problem with hidden text
As I type text in some cells, it does not always dispaly if it exceeds the cell length. I wish to keep the cell lenghts for the entire document, but do wish for teh text in that particular row to be displayed. How about if you select that cell, then format|cells|alignment tab|check wrap text And with that row selected format|row|autofit SHR77 wrote: > > As I type text in some cells, it does not always dispaly if it exceeds the > cell length. I wish to keep the cell lenghts for the entire document, but do > wish for teh text in that particular row to be displayed. -- Da...

Creating a chart based on the data in an embedded worksheet
Hi, I have a worksheet with several embedded worksheets. I would like to create a chart based on the data of one of the embedded worksheets without putting the chart in the embedded worksheet. I have tried unsuccessfully to do this. I just wondered if anyone knew how to do it. Thanks, JK JK - You're embedding worksheets within worksheets? Why? Why not just insert the worksheets in line with the main worksheet? To open or edit the embedded worksheet, the parent Excel has to open another instance of Excel, and the chart on the outside of this other instance will never be able to acce...

LNK2001 and LNK2019 errors with template class
This is a multi-part message in MIME format. ------=_NextPart_000_00BB_01C695ED.3958DA70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have a smart pointer class that uses template functions that works = fine under VC6 but it not linking under VS2005. 1>TestGridToolkitView.obj : error LNK2019: unresolved external symbol = "void __cdecl PrismGCSmartPointer(class CPrismSmartPointer<class = CDialog> &)" = (?PrismGCSmartPointer@@YAXAAV?$CPrismSmartPointer@VCDialog@@@@@Z) = referenced in function "protected: __...

Custom reports #3
Hi, I want to pull a report on how many customers I am getting every hour of the day. Does anyone out there know how to do that? I can try writing a query if someone can tell me which table I can find this information in (timestamp, transaction etc). Any help is appreciated. Regards JD This info is given at the end of the Z report. If you want to use it in a query open the Z report recipt file using the Notepad and see the fields that are used... Report.Hour.HourSales etc... Hope this helps... Carlos "JD" wrote: > Hi, > > I want to pull a report on how many cust...

Customize columns in 'Marketing List Members'
I can't figure out where one can customize the columns used within the "marketing list" entitry when you click the 'marketing list members' on the left side to show the members. I want to add some columns, like Email. Screenshot: http://i355.photobucket.com/albums/r469/canadaka_bucket/marketing_list_members.jpg Just read the Posting on the Microsoft CRM Team Blog. <canadaka@gmail.com> schrieb im Newsbeitrag news:306584c6-2043-4962-b12a-d0b9287684bb@b31g2000prb.googlegroups.com... > I can't figure out where one can customize the columns used within the >...

Textbox fomatting value based on another textbox
I have two text boxes on a form. One is a value that can be changed by the user. The second is the value 1 - textbox1. I need everthing to be in %. For example, in textbox1 the user could type 75 and it would automatically be recognized as 75% and textbox2's value would calculate to be 25%. Everytime I try textbox1's value is = to say 7500%. Any help is appreciated. Cheers, Job Maybe something like: Option Explicit Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) Dim TB1Val As Double With Me.TextBox1 If IsNumeric(.Value) Then TB1Va...

Excel List Sorting Problem (Descending)
Hi there, I'm having trouble sorting my list--my column contains *only* 4-digit numbers but when I click on "descending order", only about the first half of the rows are arranged this way, before it begins again to arrange the rest in descending order. Like this: 5120 5119 5118 4000 3050 5116 4112 etc. Has this problem happened for anybody else? I'd appreciate any help you can offer. Part of your list is text, although it looks like numbers. Format an empty cell as number. Enter the number 1. Copy. Select your "numbers". Edit>Paste Special, check Mul...

I really need help with a formview problem
I have a formview that I place a toolbar onto. In my OnInitialUpdate(), after I create the toolbar, I say GetParentFrame()->RecalcLayout(); ResizeParentToFit(FALSE); ResizeParentToFit(TRUE); The formview is still not sized properly. It looks like the problem is the toolbar on the top of the formview. It is not being taken into account in sizing the formview. The difference at the bottom of the form that is not displayed is the size of the toolbar. Any suggestions? Should work if your toolbar was created (and docked) back in your CMainFrame::OnCreate() method. ----- William Gower ...

Printing problem in booklet format
When I try to print my booklet document, on the screen it looks perfect, but when i go into print preview it only has half of each page on the paper. When i print, it comes out exactly like that. I have Publisher 2003 and run it on XP home. My printer is an Epson stylus Photo RX650. I contacted Epson and they say its a Publisher problem. Any suggestions. Driver? http://tech.epson.com.au/downloads/product.asp?sCategory=Multi_Functional&id=stylusphotorx650&FileType=1&EmailAdd=&MetricIDReturned=624915&platform=winxp Are you selecting booklet in page setup? Do you ...

problem opening up program/file
Hello, All. I am having some trouble opening up Word. It was working okay until I loaded some fonts to FontBook. Okay, now I removed all my fonts but I still get this error message about corrupt fonts I have on my computer. When I open Word, I see the blue starting-up window: Word:Mac 2004. Right underneath the product ID #, I see that it is initiating... when it gets to the point "Optimizing font menu performance" I start getting this error windows popping up one after another. (E.g. The font M TimesSmallText is corrupt and should be removed.) I keep on clicking okay for a whole lot...

Money deluxe 2007 password problem
When I update my bank account transactions I get a message saying that my account was not updated because my password is incorrect. I then go into account info and have to update my password. I save the update, but then it happens again sporadically when I open Money at later times. Is there a way to fix this glitch? ...

Outlook Today does not Customize
Hello, I have WinXP home edition with Office 2000 installed. When I am in Outlook and want to customize the "Outlook Today" screen it will not open the control panel, I can click on the "Customize Outlook Today" til I am blue in the face and it will not open...any suggestions or is this the way it is? Thanks, Kelly 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 --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discu...

MFC classes DISAPPEAR!!!!help
could someone please help me: many MFC classes almost always disappear from class browser window!!! while their files continue to be properly listed in the file browser window thanks! Bianca Try deleting the clw file and let the class wizard recreate it for you. If that doesnt help also try deleting the opt and ncb files. Or else try upgrading to Everett :-) -- Regards, Nish [VC++ MVP] "BIANCA" <bbb_1973@virgilio.it> wrote in message news:d2504dc9.0308140037.699a9ae8@posting.google.com... > could someone please help me: > many MFC classes almost always disappear from...