how to capture the button caption using an object

How to capture the button caption using an object in Dialog based MFC
..Suggest me which method to use.
       iam in urgent need of it.
                                     please give reply as soon as
possible

   Thank you.

0
8/8/2006 5:08:50 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
333 Views

Similar Articles

[PageSpeed] 32

What do you mean "capture the button caption"?  Do you mean "Read the caption on a
button"?  GetWindowText works fine for this.  Create a control variable and use it as
	CString s;
	c_MyButton.GetWindowText(s);

and you've got it.
				joe

On 7 Aug 2006 22:08:50 -0700, "lakshmi" <lakshmi.bollam@gmail.com> wrote:

>How to capture the button caption using an object in Dialog based MFC
>.Suggest me which method to use.
>       iam in urgent need of it.
>                                     please give reply as soon as
>possible
>
>   Thank you.
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)
8/8/2006 5:51:48 AM
> How to capture the button caption using an object in Dialog based MFC
> .Suggest

Use GetWindowText:

CWnd* pButton = GetDlgItem(IDC_YOURBUTTON);
ASSERT_VALID(pButton);

CString buttonCaption;
pButton->GetWindowText(buttonCaption); // buttonCaption will now have
the caption

---
Ajay

0
ajaykalra (6842)
8/8/2006 1:45:50 PM
Just to add to what Joe & Ajay wrote... you can also set the text using the 
opposite function:

SetWindowText()

In case you want to restore the value or set it to something different.

Of course this is true for any window's caption, not just a button.

Tom

"lakshmi" <lakshmi.bollam@gmail.com> wrote in message 
news:1155013730.009870.174360@h48g2000cwc.googlegroups.com...
> How to capture the button caption using an object in Dialog based MFC
> .Suggest me which method to use.
>       iam in urgent need of it.
>                                     please give reply as soon as
> possible
>
>   Thank you.
> 


0
tserface (3861)
8/8/2006 3:25:00 PM
Reply:

Similar Artilces:

Using the sum function in a 3 dimension environment
How to Use the sum function in a 3 dimension environment in Microsoft Excel? Need a detailed description for a research paper I am doing, ASAP!!!! Is this what you need? =SUM(Sheet1:Sheet3!C1) If sheet names have spaces use =SUM('sheet x:sheet y'!C1) -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Paul Hargreaves" <Paul Hargreaves@discussions.microsoft.com> wrote in message news:24F4CEEA-3A12-4922-B72B-416A9584EDD6@microsoft.com... > How to Use the sum function in a 3 dimension environment in Microsoft > Excel? > Need a detailed d...

Dating using workdays
Is there a way to autofill dates into a spreadsheet and only use workdays and not Saturdays and Sundays? no Depending on version yes, put the first date in a cell, right click the cell and copy it down, when you release the mouse button you can select weekdays.. -- Regards, Peo Sjoblom "Bill" <anonymous@discussions.microsoft.com> wrote in message news:012a01c3d543$6c197a40$a301280a@phx.gbl... > no You could try this. Put a non weekend-date in A1 Put this formula in A2 =IF(WEEKDAY(A1)=6,A1+3,A1+1) Copy it down -- HTH Bob Phillips ... looking out across Poo...

load an existing buffer using IXMLDOMDocument
Hi Experts: Is there a way to load an existing buffer (an XML file) using IXMLDOMDocumentPtr->load()? I know it works for loading an XML file, but I need to load an existing buffer with known length. Thanks In Advance! Polaris Try loadXML instead. Thanks, that worked! Is there a way to dump the current contents of IXMLDOMDocument to a buffer in memory (not a file) ? "save" does not work, it always think the buffer I passed to it is a file path. I'm trying not to use IStream. Thanks Polaris "Truong Hong Thi" <thi1981@gmail.com> wrote in message ...

Merge text stacked upon an object into one picture?
I placed a graphic (vinal record disc) then stacked text upon it via text boxes. Can they be merged into one copyable picture? What version Publisher? Group the objects, right-click, save as picture. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Chiefhollis" <Chiefhollis@discussions.microsoft.com> wrote in message news:901225A7-9A8E-4046-BF7A-5FF17E06CB6D@microsoft.com... >I placed a graphic (vinal record disc) then stacked text upon it via text > boxes. Can they be merged into one copyable picture? It ...

Input a date using a Form Button.
Hi, Please help as I'm totally lost with this one! I'm doing a little project for work and I have come across a littl problem with a date input that I have set up using a Form Button. No this button once pressed enters the date just as I want, into th correct Cell (the buttons called "Todays Date") Now I have recorded macro so that the button executes the =TODAY() comand - which is fin untill the date changes!! As you can emagine I need the date to stay a it was when first pressed as its a database I'm trying to compile. Does this make any sense to you all?? I will...

Reference Grouped Objects Using VBA
Hello I have grouped four charts, three text boxes (from the control toolbox) and a rectangle. Prior to grouping, the code I had to update the axes on both charts and text for the text boxes worked fine. After grouping the objects the code fails. How do you reference a specific object contained in a group? If Shp is a grouped shape then Shp.GroupItems(2) references the second shape in the group -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware .. "BJ" <bradley.john@westrac.com.au> wrote in message Hello I have grouped four charts, three text ...

Excel Pivottable using data in Access 2002
I have been using Access 2000 to hold tables with lots ( 200,000 rows ) of data. In Access 2000 you can make a Pivottable Form which starts Excel and really makes the pivottable there although the data actually stays in Access. Works great. I've recently gotten Access 2002 which tries to make the Pivottables itself. It's not as good. I want this new verson of Access to work with Excel like the old version. This new verson offers to let me "export" the pivottable, but that tries to start Excel and copy the data in and there's too much data for it to be able to do tha...

Use Pivot Table to Populate another table dynamically
Hi, I have a pivot table that is pulling from a large table of data with hours and projects for various clients and hours etc. I want to create an invoice that is populated dynamically with the hours and project as they change by client depending on the client filter. Is there anyway to do this? Everything I have tried has not been dynamic. Thanks ...

Can't intall Exchange 2003 SP1 using /disasterrecovery switch
Hi, I am testing a disaster recovery on my test environment. My domain is a Windows 2003 child domain, therefore my Exchange 2003 SP1 also in an administrative group (meaning, I don't have permission at Org level). I reinstalled the Windows 2003, restored the system state, applied hotfixes and then successfully reinstalled Exchange 2003 in disaster recovery mode. However, when I tried to install the Exchange SP1 using disaster recovery I failed, I got error message that "Exchange Messaging and Collaboration Services can not be assigned disaster recovery switch. Because: This is the...

Calculating page/report sums using calculated data from subquery
Here is a scenario from my report: The report will grab data with a main query into a parent row Depending on the data, a child row may exist, if it does the report will display it The child row will use data from the parent row in order to do a calculation in the child All of this works just fine and the report data is correct. Now, what I am having issues with is doing the page/report sum calculations. The requirements dictate that I need to create a sum of both the parent column and also the child column in the totals. I have been trying to do this all day and cannot see...

Which formula should I use.....
Hi there, I'm building a contract, and I need specific cells from each page in the workbook to total up on a pricing sheet (still in workbook). I've tried using IF commands to build this mammoth equation, it just isn't working. I'm getting quite frustrated, I've been working on this for a few weeks. I'm new to such detailed formulas in Excel, and any help anyone could give me would be greatly appreciated!! Thank you!!!! Heather -- HeatherCox ------------------------------------------------------------------------ HeatherCox's Profile: http://www.excelforu...

Using the primary key in an autonumber
Hi there, Needing some help with trying to generate and display an incrementing auto number on a form. I have scoured some of the forums but haven't had any luck with getting such a simple thing to work. I have a student database which I am trying to create a unique student ID number based on a set prefix each time I go to add a new student. For example: Student ID - ABC 09 1 Where ABC = set prefix 09 = the current year 1 = would represent the autonumber (primary key) The only luck I have been having with getting this to work is entering the following syntax in the...

Using ZwCreateProcess
Hello, I am trying to call ZwCreateProcess defined in the Windows DDK, and I was curious how I would go about using this to create a process. I cannot find the parameter in which I provide the path to the executable I would like to run. Thanks Why? Seriously, there needs to be a good reason. The undocumented API has its valuable uses, but I'm not sure why ZwCreateProcess would be among them (the most common use of the undocumented API is to get functionality not normally available in the WIn32 API, but CreateProcess already exists). I note that in the WIndows DDK I can't find...

Create a button to find the next record
Hi I am trying to create a button to find the next record for a particular studentID. There is a main form and subform. I want to be able to find all relevent subforms for a particular student. The master link id is STUDENTID and the child link id is STUDENTID_FK. So for student #1, when I click on the subform and click on the button, it would cycle through all this student's records. What is the best way to set up this button? Thank you for your help in advance. You already have one that is built in. Just click the navigation button right of the record number ...

How do I use excel with simply accounting
I would like to make a daily cash sheet In excel where I can enter data which I can then import into Simply accounting as a general journal entry. Is this possible and if so how -- If you could help I'd be grateful Dar I haven't used Simply Accounting, so I don't know the exact answer. There's probably some Simply Accounting who can answer. Nevertheless, thought I would comment. Have you looked Simply Accounting's built-in Help and searched for info in importing data? If it can be done, the info should be in Help, and it would probably give detailed instructions o...

use IUrlHistoryStg2 to get the history record,but how to get the user name ?
IUrlHistoryStg2 can tell you the url,titile,some visited time information.But how can I know who visit this url ? Anyone can give me some hint or code ? Thanks very much ...

Using Defined Names in Charts
I am using Office 2002. I am trying to create a chart that has only one Series called Data. The values for DATA is a name called SCROLL_DATA. The name has been defined using the Insert-Name-Define action. The workbook is called Quality Escapes.xls I have entered the following in the values box as I have seen many instruction as follows =Quality Escapes.xls!SCROLL_DATA What am I doing wrong. -- bobburg ------------------------------------------------------------------------ bobburg's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=22006 View this thread: http:/...

Change Organization name and use exisiting CRM DB
I did a search on this could not find it here. We need to change the organization name and be able to re-use the data which is already in the CRM Database. Is this going to work? what are the steps? I know probably the redeployment is one way. correct? any other way? The original CRM key and org-name was MSDN and the new one is "official" Microsoft issued license with the legal company name. Thanks for any suggestions. Regards Max Sounds like this is for v1.2. In that case, the Redeployment Tool is the only way to go. There are too many ties between the DB and AD in v1.2. -...

toolbar button
I cannot modify toolbar buttons. When I click on customize, the modify button is grayed out. Any suggestions? Just to be sure : 1. Tools > Customize > Commands Tab 2. Select Macros in left ListBox 3. Select Custom Button on right side. 4. Select the toolbar button that you are trying to modify. And you're still not able to modify your button? HTH Paul -------------------------------------------------------------------------------------------------------------- Be advised to back up your WorkBook before attempting to make changes. ----------------------------------------------...

Using ajaxToolkit:AnimationExtender in a content page
In Default.aspx I want to move a Table that is in the .Master file. I tried the following even though I didn't expect it to work; and it didn't. <%@ MasterType VirtualPath="~/Main.master" %> <asp:Content ID="Content0" ContentPlaceHolderID="TopImageCPH" runat="Server"> <asp:ScriptManager ID="ScriptManager1" runat="server"/> <ajaxToolkit:AnimationExtender ID="AnimationExtender1" runat="server" TargetControlID="Master.TableTop"> <Animations> <...

How do I code the cloning of an object in vba?
Specifically a frame containing both a textbox control and a spinbutton control. Thanks Steve Can you be more specific? What are you wanting to do? Are you just wanting to copy a control to another userform? -- Cheers, Ryan "sarndt" wrote: > Specifically a frame containing both a textbox control and a spinbutton > control. > > Thanks > > Steve ...

Open form to specific record from button on continuous form
I have a continous form with limited data and I would like to have a button which then opens up a selected record in another form. I've placed the button via the wizard and, while it opens the form, it doesn't open to the selected record. It it possible to have a button on a continous form which would then open to a bookmarked record on another form? The wizard put this code, is it possible to modify this? Thanks. Private Sub btnOpenForm_Click() On Error GoTo btnOpenForm_Click_Err DoCmd.OpenForm "frmName", acNormal, "", """...

Stop toggle buttons in excel move from the cells after previewing
I have some toggle buttons on my excel sheet. These buttons move from the cells when I do a print preview and close. How do I stop this from happening? The information in the following post by Dave Peterson may help: http://groups.google.ca/groups?&threadm=4252EFEF.C8CBA674%40netscapeXSPAM.com naveen wrote: > I have some toggle buttons on my excel sheet. These buttons move from the > cells when I do a print preview and close. How do I stop this from happening? -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html xl2002??? http://su...

How do you name and use a custom Layout
I have a spreadsheet with 30 coloumns. Differnt users access this spreadsheet and depending on their login name I wanted to display a different layout for differnt users. I have tried using custom view but it does not work. I tried cutting and inserting the cut colomn into a differnt part of the spreadsheet and named the custom view, but it did not go to it from the default layout. In other words it appears you cannot use custom views to view different layout options -- Steve F Not sure how you are going to tell the system the login name. But the custom views should work. I start with...

how do i use format cells to alpha / numeric values
HAVE A STRING OF DATA i WANT TO ENTER into a cell, but I also want to set format to set the values. eg. if I put in asd123 I want it to appear as ASD123 but there are also occasions when I will put in a different mix of letters/numbers a12s3d, which I also want to come out as A12S3D. I can do this in Access but cant seem to crack the code in excel. Please help. Try =UPPER(E2) HTH Regards, Howard "Samvid69" <Samvid69@discussions.microsoft.com> wrote in message news:701E3143-A79D-4FDE-8661-325795CE50F0@microsoft.com... > HAVE A STRING OF DATA i WANT T...