getdlgitemtext #2

Hi,

I meke code from example behind, and not working
corectly, buffor "String1" they are no my text in IDC_EDIT1 it is a somthing 
wrong this
bufor, may please send me good idea.

 void CDialogPASS::OnBnClickedButtonDp2()
{
   CString String1;

   GetDlgItemText(IDC_EDIT1, String1);

 }

mike 1010 


0
mig1010 (3)
6/30/2006 3:44:33 PM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
761 Views

Similar Articles

[PageSpeed] 32

Is IDC_EDIT1 an actual control?  I've seen this fail when the control ID changes due to
editing of the dialog.
				joe

On Fri, 30 Jun 2006 17:44:33 +0200, "1010" <mig1010@wp.pl> wrote:

>Hi,
>
>I meke code from example behind, and not working
>corectly, buffor "String1" they are no my text in IDC_EDIT1 it is a somthing 
>wrong this
>bufor, may please send me good idea.
>
> void CDialogPASS::OnBnClickedButtonDp2()
>{
>   CString String1;
>
>   GetDlgItemText(IDC_EDIT1, String1);
>
> }
>
>mike 1010 
>
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)
6/30/2006 4:12:15 PM
1010 wrote:
> Hi,
>
> I meke code from example behind, and not working
> corectly, buffor "String1" they are no my text in IDC_EDIT1 it is a somthing
> wrong this
> bufor, may please send me good idea.
>
>  void CDialogPASS::OnBnClickedButtonDp2()
> {
>    CString String1;
>
>    GetDlgItemText(IDC_EDIT1, String1);
>
>  }
>
> mike 1010

Let me know what is ur problem?
Are u not getting the text after entering in EDIT Box?You need to enter
the text in EDIT1
The above should work or else

Add a variable to IDC_EDIT1 say m_strEditVal;
Call UpdateData(TRUE) in theOnBnClickedButtonDp2.

void CDialogPASS::OnBnClickedButtonDp2()
 {
  UpdateData(TRUE);
  AfxMessageBox(m_strEditVal,0,0);
   }

0
nicetom786 (68)
6/30/2006 5:13:07 PM
You should avoid UpdateData; there are far too many problems that come up when it is used.
Create a control variable and use GetWindowText.
					joe

On 30 Jun 2006 10:13:07 -0700, nicetom786@yahoo.com wrote:

>
>1010 wrote:
>> Hi,
>>
>> I meke code from example behind, and not working
>> corectly, buffor "String1" they are no my text in IDC_EDIT1 it is a somthing
>> wrong this
>> bufor, may please send me good idea.
>>
>>  void CDialogPASS::OnBnClickedButtonDp2()
>> {
>>    CString String1;
>>
>>    GetDlgItemText(IDC_EDIT1, String1);
>>
>>  }
>>
>> mike 1010
>
>Let me know what is ur problem?
>Are u not getting the text after entering in EDIT Box?You need to enter
>the text in EDIT1
>The above should work or else
>
>Add a variable to IDC_EDIT1 say m_strEditVal;
>Call UpdateData(TRUE) in theOnBnClickedButtonDp2.
>
>void CDialogPASS::OnBnClickedButtonDp2()
> {
>  UpdateData(TRUE);
>  AfxMessageBox(m_strEditVal,0,0);
>   }
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)
6/30/2006 6:07:41 PM
If that were not a valid control ID the OP should get an ASSERT when that 
code is referenced, unless the ID is still in resource.h.  OP could check 
the return code to see how many characters were copied.

Tom

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:1ajaa2h5i3dst9hgscsstsqjkgddvtfhq9@4ax.com...
> Is IDC_EDIT1 an actual control?  I've seen this fail when the control ID 
> changes due to
> editing of the dialog.
> joe


0
tserface (3861)
6/30/2006 6:52:11 PM
The problem arises when the *value* that used to be #defined for IDC_EDIT1 is now the
value #defined from some other control, e.g., there are two declarations

#define IDC_EDIT1    203
#define IDC_OTHERCONTROL   203

Then you get a binding, avoiding the ASSERT, but there's no text in the "OTHERCONTROL"
type, so GetDlgItemText/GetWindowText would return an empty string (the last time I saw
this in a client program, the two controls were an edit control and a progress bar!)
					joe

On Fri, 30 Jun 2006 11:52:11 -0700, "Tom Serface" <tserface@msn.com> wrote:

>If that were not a valid control ID the OP should get an ASSERT when that 
>code is referenced, unless the ID is still in resource.h.  OP could check 
>the return code to see how many characters were copied.
>
>Tom
>
>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
>news:1ajaa2h5i3dst9hgscsstsqjkgddvtfhq9@4ax.com...
>> Is IDC_EDIT1 an actual control?  I've seen this fail when the control ID 
>> changes due to
>> editing of the dialog.
>> joe
>
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)
7/2/2006 3:00:00 PM
Reply:

Similar Artilces:

After merging 2 ContextMenuStrip how to call Opening ?
Hello All I ve got 2 ContextMenuStrip menu1 : _A _B menu2 : _C _D I set Opening on both menu menu1.Opening += new CancelEventHandler(MyOpening1); menu2.Opening += new CancelEventHandler(MyOpening2); now I want to merge these 2 menus into one : ContextMenuStrip newMenu= new ContextMenuStrip(); ToolStripManager.Merge(menu1, newMenu); ToolStripManager.Merge(menu2, newMenu); newMenu.Opening += new CancelEventHandler(myNewOpening); In fact I m stuck here : when the newMenu is about to be displayed, OnOpening is fired but how can I call the Opening of the o...

Exchange server 2003 SP1 #2
Exchange server 2003 standard edition running on 2000 server SP4 has just had SP1 applied. Since then, the following has been noticed. The speed of email sending and receiving has deteriorated to the point that people are questioning whether email was sent. Takes about 1 hour for a single email to arrive from someone with an account on this server. There are 7 full backups configured through the native backup program and the first one that ocurred after SP1 was installed shows up at about 17MB. The database is 10.5 GB...obviously a problem here. A manual backup fails due to parts of ...

1/2" bleed to edge
I made a flyer/ad and the person i sent it to send me the following. "In order for the grey background to trim to the edge of the page, I need about 1/2" bleed on the edge. In other words, the file you send me needs to be bigger than the actual page size with bleed space included." Does that mean i have to resize the entire file(text, tables, pictures)? i really don't want to do that as there is alot. What can i do to get that 1/2" bleed on the edge? I am using Publisher 2007 Thanks in advance Create a bleed for your publication http://office.microsoft.com/en...

How do I set up a cumulative sheet in Excel? #2
I'm trying to track employee's hours weekly and then need a year to date report. How do I do this? Tell us a little more about how the tracking for the individual employees is done: everyone on a single sheet (how is it laid out) or each employee on their own sheet (again, how is it laid out) Could be a simple solution if each person is on separate sheets, or if each employee has their own area on one huge sheet, a little more complex if all are mixed together on a single sheet, such as one that might show all employee hours per week as groups on the sheet. As a start, I'll...

why 2 'sent items' folders when 1 isn't used?
Whenever I send an email a copy is stored in the sent items folders of my default account. I would prefer to have it saved in the sent items folder of my storage folders, but can't find any way to make that happen. Why have that second folder if it is not used? Mail accounts use the Sent Items folder within the account folder. Newsgroup messages use the Storage folders/Sent Items folder - ie..the second folder is used. -- ...winston ms-mvp mail "corystes" <corystes@discussions.microsoft.com> wrote in message news:C0374B5A-7A93-40CF-939C-921E5...

Pivot table converts data to a 1,2,3 how do I get data to correct
I created a pivot table from a range of customers (deposits). Tha data range counted the number of entries per customer and not the dollar amount. How do I format the data range to reflect the dollar amount not the number of entries? Right-click on the 'Count of Deposits' button in the pivot table Choose Field Settings From the 'Summarize by' list, select Sum Click OK mjohnston1327 wrote: > I created a pivot table from a range of customers (deposits). Tha data range > counted the number of entries per customer and not the dollar amount. How do > I format t...

Event ID 8197 #2
I have been getting this error for about a week or two. The error reads: Type: Error Category: General Source: MSExchangeFBPublish Event ID: 8197 Error initializing session for virtual machine XXXXX. The error number is 0x80040111. Make sure Microsoft Exchange Store is running. The store is running and fully fuctional. I'm running Exchange on a Server 2000 SP4 and Exchange 2000 SP3. I'm getting this error every 50 minutes. I have researched this error but there isn't a solution that I see fitting. I haven't really seen a solution at all. I don'...

attachment blocking #2
HI, I am using exchange2003.In that server i want to restrict harmful virus attachements like.. .scr,.exe,.pix ,etc.. With out using any third parties is it possible to do ????.I know we can resrict individually through outlook client. I need a solution or script that i want to stop all the harmful attachements in the exchange2003 server only. Thank you very much. Srikrishna "=?Utf-8?B?U3Jpa3Jpc2huYQ==?=" <Srikrishna@discussions.microsoft.com> wrote in news:07793E55-7311-47F8-8EA4-30E04A697A4F@microsoft.com: > I am using exchange2003.In that server i want to ...

Multiple installations in one Domain?? MS CRM 1.2!
Hello, we have the following problem: We need a MS CRM of 1.2 server for some tests. We had installed a 1.2 Server in former times. We have since deinstalled the Server. Now we wanted to install CRM on another server. But MS CRM 1.2 wants to start the services of the first server. We have problems with the access to the ActiveDirectory. But we have all rights! A tried Redeployment breaks off while connecting the IIS. Any ideas? Greetings, Stefan I responded on the crm sandbox site. ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "...

Quickbooks #2
Can I switch from QB to money? In microsoft.public.money, gary wrote: >Can I switch from QB to money? Money will not convert Quickbooks files. Yes, but money will not convert your files Bob "gary" <anonymous@discussions.microsoft.com> wrote in message news:1287201c3f639$d0076460$a601280a@phx.gbl... > Can I switch from QB to money? ...

Printing a booklet #2
What's the trick in setting up a 4-page booklet (1 8x5 sheet) so that I can print front & back pages 1 & 4, *and then* reload the paper to print the inside pages, 2 & 3? I'm sure it can be done but I'm just not seeing it in the print options. I'm using Publisher 2003. Thanks, David There is no trick... Print, current page, click no, turn the page over, print, current page, click no. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "DavidJ726" <DavidJ726@hasnoaddress.com> wrote in mess...

Installed 2 LiteOn SATA drives - Win7 64bit does not recognize
After my IDE drives were not seen by Win7 64bit, I bought 2 LiteOn Sata drives OEM from Newegg. I have SATA cables, and power cable to attach 2 SATA cables from the drives. Attached both cables to the power cable (which is split - one power plug and hookup for the 2 SATA cables. Installed and still Windows Explorer will not see them. I've looked in my BIOS and have 3 options for the OnChip SATA device: IDE RAID AHCI I have it set to IDE, no good. I've tried AHCI and no good. I am not rigged for RAID and don't want it. Does anyone have any idea of what's w...

transpose #2
How do I do a transpose in excel 2002? Thanks. Highlight your range > Right click Copy > select a blank cell > Right click Paste Special > Transpose > OK "abc" wrote: > How do I do a transpose in excel 2002? Thanks. > > > ...

RE: System Mailbox #2
Greetings, Can someone tell me if there is a way to access the 'SystemMailbox' mailbox that shows up under >First Storage Group>Mailboxes, where all the user mailboxes are? is there a default password? thx B it's not something you really want to go poking around in. But to satisfy your curiosity, check out Evans article: http://blogs.msdn.com/evand/archive/2004/12/17/323636.aspx Teo teo at inventrix dot net "Boris the Spider" wrote: > Greetings, > > Can someone tell me if there is a way to access the 'SystemMailbox' mailbox > that...

Modifying Date Range 2
Now, I need to modify the expression: Between [Forms].[frmReport].[StartDate] And [Forms].[frmReport].[EndDate] Is there a way to modify the expression above so that: [StartDate] mm/dd/yyyy mm=01, dd =01, and yyyy= the year entered and [EndDate] mm/dd/yyyy mm= the month entered, dd= the day entered, and yyyy= the year entered A date is entered into [StartDate] and [EndDate] from the form “frmReport” in the format of mm/dd/yyyy. Thanks Again -- Message posted via http://www.accessmonster.com Thanks Ken -- Message posted via AccessMonster.com http://www.accessmonster.com/Uw...

Can I add a borders toolbar to Excel 2000 like the one in Excel 2.
Can I add the manual borders toolbar to Excel 2000 like the boders toolbar in Excel 2003? Thanks brunscom@msn.com I don't use xl2003, but in earlier versions, I created my own toolbar: Tools|customize|toolbars tab|new... Then dragged a bunch of icons from the Commands Tab (Format Category) to that toolbar. There's a bunch! brunscom@msn.com wrote: > > Can I add the manual borders toolbar to Excel 2000 like the boders toolbar in > Excel 2003? Thanks brunscom@msn.com -- Dave Peterson Dave, Thank you for an innovative answer. I have Excel 2003 on my desjtop and Exc...

remote exchange server #2
How can i do to connect my server e2k3 to a remote e2k3 in other administrative group in my first organization?! There is a standard method or there are more?! There is a good document who explain this?! thanks ...

Compare 2 lists
Is there a native way in Excel to compare List1 and List2 and find out which records are missing between them? Up to now I have imported the information into Access and done an unmatched query. Windows 2000 OS MS Office 2000 Dave French Hi Dave, See Chip Pearson's page http://www.cpearson.com/excel/duplicat.htm#ExtractingCommon Extracting Values On One List And Not Another (just below the above link) --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/d...

database access #2
hi! i would like to connect to a mysql dbms from within mfc. should i use odbc or is there any other newer technology? thnaks, philipp I've used ADO, but have since switched to ODBC. I recommed DSN-less connections - so you can easily connect to any table or database for which you have access rights. Also, no need to create or know the DSN on various systems. It takes a touch more work to begin with, but you can build a ODBC connection class that will handle that. Balboos Philipp Huber wrote: > hi! > > i would like to connect to a mysql dbms from within mfc. > >...

Chart series #2
Hello! I have previously posted questions in this field but I have never gotten an answer. I really really need help with this. I have never programmed before and now I am supposed to do this VBA application for Excel. What I want to do is simple enough but I have trouble implementing it and since and really do not know anything about programming I do not know what is wrong. The problem is that I am supposed to replace the existing series for a chart with new series. I have the new series but when applying them to a new chart it does not work if I have not manually erased the old chart ...

POS 1.2 missing admin password
Hi, I am a small business specialist. I just got a call from a client saying that after she installed and migrated MS POS 1.2 from her old computer to the new computer, she got some compatibility issues. She mentioned that she lost her admin password for the system, since I have no experience on POS 1.2, do you know where should I find out more in order to help this client? Thanks. Regards, Edwin Well, it is probably RMS 1.2 rather than MSPOS. MS Point of Sale (MSPOS) and Microsoft Retail Management System (RMS) are two differnet products. RMS *does* include an application called ...

learning MFC #2
Hi there, where can I find some online tutorials to learn MFC programming? Thnx alot! "Marc Schodermayr" <SchodMC@muv.com> wrote: >Hi there, > >where can I find some online tutorials to learn MFC programming? Check the Scribble tutorial. It's in your MSDN library, and online at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vctutor98/html/_gs_build_scribble.2c_.step_5.asp -- Tim Slattery MS MVP(DTS) Slattery_T@bls.gov This site also has gud material: http://www.softlookup.com/tutorial/vc%2B%2B/ Vijay "Marc Schodermayr" <...

SMTP Problems #2
Hi, I'll do my best to explain my problem: I use Exchange 2000 SP3. I use a SMTP Connector that uses a "Smart Host" to connect to my ISP SMTP. When I goto the Monitoring & Status I frequently get "SMTP Outbound" (Name of my connector) UNAVAILABLE. I'm trying to time the intervals but is ussually lasts about 5min. Then become available for a while and goes back to unavailable? The messages outbound messages are not sent when messages in the queue. And the "SMTP OutBound" connection state is on "Retry" Is just started happening and I ca...

OUTLLIB.DLL error #2
I am getting a Outllib.dll error when I am trying to create a new appointment or new contact. This problem has just occurred in the past few days. I do have a Dell Handheld that syncs to my outlook, and has not given me problems in the past. I have tried already to detect and repair the errors, but the error still happens. Any help would be greatly appreciated! Thanks. "Karen" <karenday@yahoo.com> wrote in message news:017601c3a498$034c9280$a401280a@phx.gbl... > I am getting a Outllib.dll error when I am trying to > create a new appointment or new contact. ...

how do i get picturers of world war 2
i need help geting pictures of world war 2 i need it for school www.google.com www.bing.com -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Eve" <Eve@discussions.microsoft.com> wrote in message news:8BE9F4EE-0BB1-49DD-9EF4-1B0E6688C351@microsoft.com... >i need help geting pictures of world war 2 i need it for school I find a Google Images search is usually productive. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "...