Subclass question

Hi, I am writing an app in which I have a dialog bar (IDD_DLGBAR) at the top
of the MDI frame window besides the standard toolbar.  The dialog bar
contains several controls.  One of them is a combo box with id
IDC_SEARCHBOX.  I also created a class CSearchBox (derived from CComboBox)
to process keyboard messages.  My question is how do I link the combo box in
the dialog bar with CSearchBox class so I can capture keyboard events (i.e.,
PreTranslateMessage)?  Thanks in advance.



0
xg1 (25)
1/18/2005 1:25:26 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
717 Views

Similar Articles

[PageSpeed] 37

>Hi, I am writing an app in which I have a dialog bar (IDD_DLGBAR) at the top
>of the MDI frame window besides the standard toolbar.  The dialog bar
>contains several controls.  One of them is a combo box with id
>IDC_SEARCHBOX.  I also created a class CSearchBox (derived from CComboBox)
>to process keyboard messages.  My question is how do I link the combo box in
>the dialog bar with CSearchBox class so I can capture keyboard events (i.e.,
>PreTranslateMessage)? 

Attach a control member variable of your derived class to your combo
box control.

Dave
0
davidl7375 (2060)
1/18/2005 2:27:30 PM
Reply:

Similar Artilces:

Subclassing
Hello, Im very new to c++ programming so pardon me if this is a dumb question and my bad english. I made a subclass from CListBox. I want to handle all the list controls derived from this class on one function, for example, void CListBox_SC::OnRButtonUp(UINT nFlags, CPoint point) { ..... } on this function I want to manage the OnRButtonUp event, and with a switch or if statement, select the code to execute. The following does work: SetCurSel(ItemFromPoint(point, ifp)); but the following comparison is never true, (IDC_LST_TIPO is a resource for one of the ListBoxes) UINT currLst = It...

WaitForSingleObject Question
I have a program with 2 worker threads and each thread uses WaitForMultipleObjects to either shut down or perform a task. Inside each thread there is a loop started by an event that currently uses Sleep(n) to delay an action by a variable time, n. I would like to replace the Sleep(n) with a WaitForSingleObject so I can stop the process if I need to but also use the timeout feature of the WaitForSingleObject to create the variable delay.... If I assume that both threads are in the middle of the timeout, waiting for an event and I need to shutdown, can I use the same event to shutdown b...

Custom Drawing CEdit : Subclassing
Hello experts, My objective is simple, but I'm not entirely sure what needs tweaking. I am using MSVC 6, and I would like to subclass the CEdit box so that it appears as the color-picker editbox of a PropertyGrid. There is a color box followed by three values. Like this: [###] 255; 192; 192 Where ### is just a color box representation of the value. So thus far, I've made a masked CEdit box, where I can edit the numbers (or click a button that visually sets the numbers from a different window), and I'm happy with that - but what I would like to do next is to subclass the dra...

Questions on emailing access reports in a snp and PFD format & FAX
I am in the process of developing an application which is to send ACCESS reports to suppliers (Monthly Supplier Performance Report cards). I am using the VBA code from the references which I was directed to, from this forum. I use the Stephan Labans code to convert the ACCESS report to a PDF format. I send a MS Outlook message with 2 attachments (a snapshot {snp} and PDF version of the report). Currently the code works if I close the open PDF version of the report before the code increments to the next supplier (next recordset record). If I do not manually close the displayed PDF...

Reporting Question 10-30-07
I have a custom report that I need to run every month. However, I am needing to change the query each time I run it to change the date that this report is centered around. Can anyone tell me an easy to do this without having to recreate a report each month and export it to excel and change the formatting?? Please help. what parameters or conditions r you using in query? If you post here , might be someone of us can give you the overview. /Aamir Can you use a more generic date/time logic such as records in the last 2 weeks, last month, etc? You can build this type of logic into you...

Legend question
I have 3 rows of data; Dollars Calls Cost per Call Pretty simple except the boss now wants me to chart it and put the dollars row in the legend at the bottom but not have it show up in the chart. Is this possible? Thanks Davin Hi David- Try it this way; 1) Create the chart by selecting all the data (including labels), 2) Go to Chart>Source Data--Series, select the listing for Dollars & change the Values to a reference for an empty cell (preferably far away from any area of the sheet you intend to use), 3) For the Order, right-click a column & choose Format Data Series. ...

Question on DragQueryFile
I am currently using the DragQueryFile funtion with iFile parameter set to 0xFFFFFFFF to get a count of the files dropped. Unfortunately if the dropped files are shortcut files, this function returns '1' regardless of number of files got dropped. Does anyone know how to get around this problem. Thank You! Ririko Horvath wrote: >I am currently using the DragQueryFile funtion with iFile parameter set to >0xFFFFFFFF to get a count of the files dropped. Unfortunately if the dropped >files are shortcut files, this function returns '1' regardless of number of >files...

SQL select statement question
My dataset has 3 columns: customer id, store location, charges I'd like to write a single select statment that will show each customer id once, with the store location where they have the most charges, and the sum of the charges for that store location. This gives the max charges for each customer, but doesn't give the location: select a.custID, max(new.amt) from smallchg a inner join; (select custID, location, sum(charges) as amt from smallchg group by custID, location) as new ; on a.custID= new.CustID group by a.CustID thanks. joel Try this -- SELECT TOP 1 ...

A Question, Hiding Child frame in MDI App.
Hi, everybody. I need to hide child frame in MDI app. But, I will use document and view in the child frame. So, I've got to hide the child frame with no destruction. ShowWindow( SW_HIDE ) makes the child frame just minimize. Is it possible to hide child frame in MDI app? I need your helps. Help me~ On Jan 31, 12:39=A0am, MuMbi <mu...@daum.net> wrote: > Hi, everybody. > > I need to hide child frame in MDI app. > > But, I will use document and view in the child frame. > > So, I've got to hide the child frame with no destruction. ...

intersect question
Is it possible to use more than once the intersect methode? I tried next code, but it does not work. Any ideas? Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub Set LastCellChanged = Target If not intersect(LastCellChanged, Range("f6:f25") is nothing then 'Do something else If not intersect(LastCellChanged, Range("h2") is nothing then 'Do something else else 'Do 3rd thing end if end if End Sub Ju...

Active service question
In a two-node active/passive exchange cluster, when the node1 is up, the services are started only in node 1 or on both nodes?! Ask this because i have this situation in my two BE cluster (one 2000 and one 2003) On Thu, 17 Mar 2005 10:58:24 +0100, "MMC" <ryuken_26@yahoo.it> wrote: >In a two-node active/passive exchange cluster, when the node1 is up, the >services are started only in node 1 or on both nodes?! >Ask this because i have this situation in my two BE cluster (one 2000 and >one 2003) > If I read the question right, only on the node that hosts the ac...

11 x 17 question
I am trying to create an 11 x 17 page and print it on two sheets of 8 1/2 x 11. However I can only seem to be able to do it on 4 sheets. Why is that and is there a way to change it to 2 sheets. Have you tried deleting the extra pages? -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "jenof7" <jenof7@discussions.microsoft.com> wrote in message news:007BE8C3-D506-4641-8DF8-C7C444A61324@microsoft.com... >I am trying to create an 11 x 17 page and print it on two sheets of 8 1/2 x > 11. However I...

Help with subclassing a RichEditCtrl
Hi folks, I could use some help. As a side project I am trying to write a DLL that will extend the functionality of an existing application that I do not have source code for, i.e., some autocompletion functionality, word lookup, etc. In the actual DLL, I am going to have to inject it into the existing app and then use FindWindow or something like that to subclass the existing RichEditCtrl. I need to be able to process the WM_CHAR and WM_KEYDOWN messages only. I started out by creating my own sample project using a RichEditCtrl in my project to code my object. I've now moved everythin...

Scroller chart questions
-------------------------------------------------------------------------------- http://www.andypope.info/charts/Scrolling.htm I am confused where the reference range SCROLL_DATA and SCROLL_LABELS are set. -- slamm ------------------------------------------------------------------------ slamm's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=15018 View this thread: http://www.excelforum.com/showthread.php?threadid=382365 with the help of Andy pope's page I have preapred a scroller chart file. If you are interested send me an email and I shall send it as...

General Permissions Question
Hi, Would there be any good reason to remove the System Account from the Exchsrvr main folder? I believe this is why I am receiving errors for our McAfee Exchange Virus scanner. Not sure why the account was removed, but I am thinking that this is our problem. thanks in advance for any help/ideas, Mel Hi, System account is for the oprating sysytem to access that folder it's a requierd permission for exchange server to function properly. ---cheers "Mel" wrote: > Hi, > > Would there be any good reason to remove the System Account from the > Exchsrvr main f...

question #8
I have this sheet. All data is input through an userform. I now need to make sure that data is not input twice... I mean... it can be input twice but I need to send a warning to the operator and I need both identical lines to be shown (in an userform?) with the choice to a. accept the input b. delete one of the 2 entries to avoid problems I would like to know if it is possible to format the cells in the sheet so that no matter what the operator writes the caracters are always capital.... I hope I make any sense.... thanks A better subject line will get more answers but YES, you may ...

SelectClipRgn question
Hi, I have: HRGN hRgn; ::GetClipRgn(pDC->m_hDC, hRgn); .... do stuff ... ::SelectClipRgn(NULL); Now, do I have to call DeleteObject on hRgn? I'm assuming not, because I didn't create the region. Correct? Now, I do: RECT rc = { 0, 0, 10, 10 }; HRGN hRgn = CreateRectRgnIndirect(&rc); ::SelectClipRgn(pDC-m_hDC, hRgn); DeleteObject(hRgn); I correctely am calling DeleteObject right? The online docs do not mention having to do that, but I saw it done elsewhere on the net. Lisa "Lisa Pearlson" <no@spam.plz> wrote in message news:etppGfzsEHA.3320@TK2MSFTNGP15.p...

Question about Name Order
Hi, I'm trying to help a friend out, but I couldn't track down anything on this: When clicking on Tools > Address Book, the names are listed first name first (John Smith). When typing in the search box, it searches on the first name. Is there any way to get this to work last name first instead? I've tried going into Tools > E-Mail Accounts, clicking "View or change existing directories or address books", and changing the properties of the address book. I have also gone to Tools > Options > Preferences and clicking "Contact Options". Neither o...

WM_CREATE for a subclass
Hi All, I am fairly new to C++, although I have developed OO windows applications in the past using CTD and Power Builder. I am developeing an edit class based on a CEdit. I am trying to trap the WM_CREATE message to modify the style of the window (i.e. to make is multiline). For some reason the control does not appear to be getting the WM_CREATE message ( or at least it is not implementing the handler I have for it). At present I create an edit control on a form and the Subclass the edit. This appears to work as my user defined menu is used and my color modifications appear as requir...

Tab control questions
Using Office 2003 and Windows XP; When using a tab control: 1) Does it wrap automatically so that the tabs are more than one layer deep if additional tabs are inserted? 2) Is there a way to control when the tabs wrap to a second row or where the break will occur or is this just automatic (i.e. whenever it runs out of room)? 3) I'm sure I won't get anywhere near it, but what is the limit on the number of tabs? Thanks in advance. On Dec 17, 10:45 am, XP <X...@discussions.microsoft.com> wrote: > Using Office 2003 and Windows XP; > > When using a tab control: > ...

Have a question
This is a multi-part message in MIME format. ------=_NextPart_000_005E_01C6644F.C91C0AD0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I hope this is not a repost... I have a Excel Workbook with four tabs. Now I want to get information = from 1-3 (totals) tabs and place that information into some cells on tab = 4. I don't want to cut and paste, I would like it to be a =3Dsum or = something like that.=20 Can this be done? --=20 Devon ------=_NextPart_000_005E_01C6644F.C91C0AD0 Content-Type: text/html; charset="iso-8859-1&quo...

Pivate Sub Question
If I had 6 buttons that I deleted off my form, how come the Private Subs did not get deleted?and how do I know if there is any more Private Subs that do nothing................Thanks Bob Bob napisa�(a):> If I had 6 buttons that I deleted off my form, how come the Private Subs did > not get deleted?> and how do I know if there is any more Private Subs that do > nothing................Thanks Bob > > Hmm, it is difficult...

Question about forms embedded in emails
Hi All, I am interested in the possibility of embedding forms in emails. I would like to discover what Outlook configuration settings may affect the ability to receive an HTML email with a form embedded in it - in working order of course. Can anyone point me to information about this? Thanks Colin G -- coling http://forums.slipstick.com ...

Tough Formula Question
Scenario: Sheet with db output regarding product sales. Second sheet w/ trend line formulas to predict how many to order for the next month. Works fine. Here's the poblem. Lets say it predicts I sould purchase 4 bottles of coke. Coke is only sold in incriments of 6 bottles. How to I make it round up by incriments of order number. The order incriments are part of the db output so that should help. I'm pretty sure I'll always want to round up. This cannot be a vb problem. It needs to be a formula. Thanks for any help and good luck. Hi Try =CEILING(number,order_size) =CEILING(8...

Subclassing CWinThread
I created a subclass of CWinThread - no big deal! Now, what I would like to do is use that subclass as a base class for a couple of other, more specialized classes. How can I do this? If I create a subclass as a generic C++ class, then I'm running into the assertion, "Invalid Address specified to RtlValidateHeap( 00940000, 0042DBA0 )" when I post the quit message to the thread. I assume this might have something to do with the virtual/non-virtual constructor combination of the MFC class and the generic C++ class. Any thoughts? Create more subclasses of CWinThread, then ...