Re to David Lowndes :ComboBox - changing it's text while running

  Thank you very much
I did it , but in the line DDX_Control(pDX, IDC_COMBO_SELECT_ATTRIBUTE, m_CmbAttribute); that it plants in my code when I add the control variable to my comboBox, it brings an error message, when I debug it and enter the DDX_Control function, it stops at this line   :    ASSERT(!pDX->m_bSaveAndValidate)

What does that meen

     ----- David Lowndes wrote: ----
    
     >I just want to be able to change the data of the comboBox
     >I saw that the AddString function demands a pointer to the comboBox, and I don't know whether it is being created if I create the combo from the dialog. so, I tried also to creat the combo using script, as follows
     
    
     If you've got a combo box on a dialog, then the easiest thing to d
     with MFC is to attach a control member variable to the control on th
     dialog (using the facilities of the IDE from the dialog editor). Tha
     will add a CComboBox member variable to your dialog class, so all yo
     need to do is use that and populate the combo box.
    
     	m_ctlMyCB.AddString( "Whatever" )
    
     >BUT nothing appeared on the dialog when I ran the program
    
     One other gotcha with combo boxes - in the dialog editor, click th
     drop down button of the combo box in order to set the drop-down lis
     size
    
     >One more question - do I need the InitStorage function
    
     You don't have to - as the documentation says "This function help
     speed up the initialization of list boxes that have a large number o
     items (more than 100). 
    
     Dav
     --
     MVP VC++ FAQ: http://www.mvps.org/vcfa
     
0
anonymous (74722)
5/2/2004 8:46:04 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
602 Views

Similar Articles

[PageSpeed] 47

You didn't say what file and line the ASSERT is in, which makes it sort of hard to guess
what might be wrong. Also, you didn't say if you are using VS6 or VS7

The closest likely ASSERT I found was in dlgdata.cpp, line 624. It indicates that you have
done an UpdateData to capture the value in a control before the control is actually bound;
this leads me to conjecture that you have used UpdateData before the implicit one done by
OnInitDialog, and the consequences of doing that would lead to the error you see.

First, I believe that calling UpdateData yourself is always a mistake. Lots of people
disagree with me, but I find the consequences of its misuse to be far more difficult to
deal with than the consequences of not using it at all. I'd suggest that you look for uses
of UpdateData, and make sure that none of them can be called before OnInitDialog has
completed. Better still, remove all of them and follow the advice in my article on
Avoiding UpdateData on my MVP Tips site.
					joe

On Sun, 2 May 2004 01:46:04 -0700, "Liat" <anonymous@discussions.microsoft.com> wrote:

>  Thank you very much.
>I did it , but in the line DDX_Control(pDX, IDC_COMBO_SELECT_ATTRIBUTE, m_CmbAttribute); that it plants in my code when I add the control variable to my comboBox, it brings an error message, when I debug it and enter the DDX_Control function, it stops at this line   :    ASSERT(!pDX->m_bSaveAndValidate);
>
>What does that meen?
>
>
>     ----- David Lowndes wrote: -----
>     
>     >I just want to be able to change the data of the comboBox.
>     >I saw that the AddString function demands a pointer to the comboBox, and I don't know whether it is being created if I create the combo from the dialog. so, I tried also to creat the combo using script, as follows:
>     >
>     
>     If you've got a combo box on a dialog, then the easiest thing to do
>     with MFC is to attach a control member variable to the control on the
>     dialog (using the facilities of the IDE from the dialog editor). That
>     will add a CComboBox member variable to your dialog class, so all you
>     need to do is use that and populate the combo box..
>     
>     	m_ctlMyCB.AddString( "Whatever" );
>     
>     >BUT nothing appeared on the dialog when I ran the program.
>     
>     One other gotcha with combo boxes - in the dialog editor, click the
>     drop down button of the combo box in order to set the drop-down list
>     size.
>     
>     >One more question - do I need the InitStorage function?
>     
>     You don't have to - as the documentation says "This function helps
>     speed up the initialization of list boxes that have a large number of
>     items (more than 100). "
>     
>     Dave
>     -- 
>     MVP VC++ FAQ: http://www.mvps.org/vcfaq
>     

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
5/2/2004 10:33:33 PM
Reply:

Similar Artilces:

cascade combobox in a subform
Please help, with a cascade combobox in a sub form. I would like make a selection from the combobox named cboSiteID in my main form named f4Project and have the combobox named cboUnitID in my sub form named t032ProjUnit be limited to only the records relating to the SiteID. How can this be done? Thanks in advance!! -- deb deb wrote: > Please help, with a cascade combobox in a sub form. > > I would like make a selection from the combobox named cboSiteID in my main > form named f4Project and have the combobox named cboUnitID in my sub form > named t032ProjUnit be limit...

Change the working directory for a MFC application
I am trying to change the working directory of a MFC application after the application execution begins. Chdir or setcurrentdirectory doesnot work for a MFC application. Can anyone suggest how i can do this? Thanks, - Akila. Akila wrote: > I am trying to change the working directory of a MFC application after > the application execution begins. > > Chdir or setcurrentdirectory doesnot work for a MFC application. > > Can anyone suggest how i can do this? > > Thanks, > - Akila. > SetCurrentDirectory does work for a MFC application. If it doesn't seem ...

Standard Cost Changes Screen
I'm trying to enter a proposed standard cost on a finished good item but the Proposed Standard Cost Field is greyed out. Cards >> Manufacturing >> Inventory >> Standard Cost Changes. Any ideas as to why it's Greyed Out, and how can I fix this? regards, davidv Is the Bill of Materil a "Phantom" item? "tintin91" wrote: > I'm trying to enter a proposed standard cost on a finished good item but the > Proposed Standard Cost Field is greyed out. > > Cards >> Manufacturing >> Inventory >> Standard Cost Changes. &...

MS Excel file extension changed through e-mail
MS Excel .xlsx files sent as attachments are received without the x, as a .xls instead. The same is true for MS Word .docx changed to .doc Answered in the Word group. Please don't post the same question in multiple groups. It not only causes responders to waste their time replying to questions that have already been answered but it also makes it more difficult for you to follow up on the replies. If it truly is an issue that involves more than one app either post to the Office group rather than the individual groups or use a newsreader rather than the web interface & learn to ...

Problems with re-setting the last active cell in an Excel workshee
I am trying to re-set the last active cell on an Excel 2002 worksheet (in this particular sheet it should be cell DA197). I have used both the methods described in the Knowledge Base article (deleting rows and columns and re-saving; and the Excess Format Cleaner add-in). Deleting the rows and columns does not work; using the Excess Format Cleaner does not work either and it then also hides the rows from 198 to 65536 - but does not do the same for the columns. I have checked that there is no protection on the worksheet. Has anyone else come across this problem and if so can you please ...

Cannot change account type.
I have an HSA with a credit union that is updated online, I want to have it listed under the Investment Accounts instead of Bank Accounts. The option to change the account type is greyed out with the message "...online-enable account cannot be changed" Was there a question here? I think the message you got tells you about three fourths of the problem. The final fourth that the first three fourths prevents you from getting to is that an Investment Account and a Bank Account are fundamentally different types--one holds Investments, the other holds cash--so a change from one ...

How do I un-"Group" my workbook; cannot see entire pane or move/re
...

Add Word and change format
1) Let say colomn A is a product codes, such as "PK0021", "UQ05P8", etc...Now I want add a "Z" in front the codes. To be "ZPK0021, ZUQ05P8". What's the faster way in case I got thousand of codes? 2) In my colomn B is such code as "18-521-65, 18-81-84, 18-1112-65" and etc. Now I would like to make it to be standard to 4 digit for the middle number to be "18-0521-65, 18-0081-84, 18-1112-65" ... As the same senario as above, I got more than thousand of such codes... What's the faster way? Kelvin The first could be done wi...

zoom on RTF text
Hi all, I am currently developing a windowless textbox object using ITextServices. Everything went very well until performed zoom on text. In my code the RTF text is rendered using TxDraw, which calculates zoom factor as this: zoom factor = (pixel height of client rect)*2540/[Himetric vertical extent]*[pixel per vertical inch]. But the result wasn't really that good, the scaled text often went out of box, and word wrap wasn't consistent specially when it scaled below 60%(above 100% much better). Does anybody know what problems caused it? Any input would be appreciated. Thanks. jm H...

Text to dates
I have a column of dates F6:F148, the dates have been entered in the following formats all entered as text "21.01.2009","21.1.2009","21 Jan 09" & "21 Jan 2009". I'd like to be able to change them all into a common date format 21 Jan 09 (I'll also change the sheet so that data is validated to this date format) Does anyone know a way I can do this? Thanks You can use the 'Convert Text to Columns Wizard to convert the dates --Select the range of dates which needs to be corrected. --From menu Data>'Text to Col...

Serious performance issues when changing roles
Just a heads-up: don't change roles during times of heavy user activity or you may have severe performance issues. When you change a role, the MSCRMSEcurityService evidently kicks off a massive job that updates the securitydescriptor field in every record of every major object. Last time I did this, it attempted to obtain a table lock, and as a result, brought my system to its knees. The process was trying to update 46000+ rows from the annotationbase table (you can see this by looking at the last SQL command for the process that is blocking other processes). Evidently bec...

Change Withdrawal/Deposit to Transfer
Hi folks. How do you change a transaction that's already been recorded from a Withdrawal or Deposit to a Transfer? Thanks. Dave I'm assuming you are using Transaction Forms. Most people who have used Money for a long time would advise just turning them off. You can also change the category to Transfer: or one of the Expense categories. There is also For a WD -> Transfer switch the Transfer seems Options|Change Transaction To. <bvdesk@gmail.com> wrote in message news:1175621813.359866.84060@b75g2000hsg.googlegroups.com... > Hi folks. How do you change a transaction...

Cannot select a range of text
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I am unable to select a range of text with either the track pad or my mouse. I am able to double- or triple-click to select, and can use keyboard commands to select all, etc. <br><br>This is a new problem that has not existed before. <br><br>Thanks! <br><br>Art Hi Arthur: Not enough information to answer. Please carry out some diagnostic testing for us: 1) Is this one document, several documents, or all documents? 2) Is this both .doc and .docx? If not, which ...

How do I change the text size in a drop down box
I am using excel 2003. It seems to default to 10pts. Changing the size in the source list or the default in the general tab did not change the size. ...

choice to colour text
Hi, hope someone can help. I have a shared spreadsheet with quite a lot of users. I need to categorise who is using the spreadsheet so that text that they add comes up in a different colour. Is there anyway to do this? I realise they could just change the text colour themselves, but it would be simpler in the long run if when they tried to input text they were faced with a question, and the answer changed the text colour automatically. Any help is much appreciated! Nick Hi, Maybe a user has to log in to the worksheet. eg when the sheet opens, an input box asks for username. The a...

Problem with Text box and Background
I am using the background as a temple for a form I add test boxes where I want to have text typed in The problem is when I print the page the text I have typed in isn't where it is supposed to be It is below the line of the background form How do I solve this problem? Web page? Best asked in the publisher.webdesign group -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "News" <gmhull@sbcglobal.net> wrote in message news:pOKFf.27487$F_3.19174@newssvr29.news.prodigy.net... >I am using the background as a t...

VBA to add and remove text within cells
Hi, I have a field named "Postal" at the top of column F that always include a number with 5 digits then a city name then a region name, such as "11090 CARCASSONNE Linguadoca-Rossiglione". I need to create a program to have this field changed as following : "F-11090", then copying "CARCASSONNE" into the City field which is empty (column G). The city name is always starting just one space character after the postcode, same thing for the region name, it always starts one space character after the city name. The region has to be removed completely. ...

Dialog text only updated on mouse moves
My PreTranslateMessage() function has code in it to update some of the text in one of my dialog boxes. It works, but instead of updating it every second, it only udpates the text when my mouse is moving or clicking. Any ideas on what might be causing this? Thank you! Well, that's becuase PreTranslateMessage gets called only when there is message in the queue for that window. Instead use a timer. See OnTimer (WM_TIMER) AliR. <PloutzMR@Npt.NUWC.Navy.Mil> wrote in message news:1154456910.215194.170930@s13g2000cwa.googlegroups.com... > My PreTranslateMessage() function has c...

text boxes that label axes in line/scatter graphs
I tried to use "SAT-M" as y-axis label, but "M" was cut off (actually went to second line that could not be seen). I tried every trick I know to lengthen the text box, to fit label on one line. Hi, The only way to length chart textboxes is with more text. But at some point more text will cause the content to wrap. The charts textboxes do not have the ability to be sized manually even though the bounding box and grab handles would suggest otherwise. Try adding a few spaces or even non-breaking spaces ALT+0160 (Numpad) Cheers Andy Peg wrote: > I tried to use &qu...

Re:Re: Excel Problem
This is a multi-part message in MIME format. ------=_NextPart_000_0083_01C5D615.37853060 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have some sheets 1;2;3;4; ETC................. I would like the new page list release with one botton: A1-Nome de sheet(1;2;3;4; ETC) A2-Date(C50:C80) A3-Import (D50:D90) Best regards Marcello "Bob Phillips" <bob.phillips@notheretiscali.co.uk> ha scritto nel = messaggio=20 news:uk86X7v0FHA.3188@TK2MSFTNGP14.phx.gbl... > Marcello, > > I am not absolutely clear as to what you...

Word documents are re-formatted to an undesired font on opening
I have saved documents with an Arial based style but on re-opening the styles have Times New Roman and different font sizes. How did you change the styles? -- Stefan Blom Microsoft Word MVP "KeithCC" <KeithCC@discussions.microsoft.com> wrote in message news:1C7387D1-C9F8-4E37-AF7F-7CD79CAC2042@microsoft.com... >I have saved documents with an Arial based style but on re-opening the >styles > have Times New Roman and different font sizes. ...

cannot change part of a merged cell
Annoying problem... I merged cells and come time to paste from the clipboard into a merged cell, I get the error it can't be done. I can hit F2 and paste. It's an annoying step and users who are not quick on the draw with Excel would be stuck. Is there a way to stop the error and succeed with a paste? thanks! don't use office clipboard use Ctrl + C & Ctrl +V On Apr 7, 5:46=A0am, "shank" <sh...@tampabay.rr.com> wrote: > Annoying problem... > I merged cells and come time to paste from the clipboard into a merged cel= l, > I get the error it can...

Strange problem while running MFC 7.0 apps on Windows 2000
Hello, I'm writing an MFC 7.1 program and it runs smoothly on XP and 98. However, on Windows 2000 I encountered a strange message saying that The application failed to initailize properly (0xc0000005). Click on OK to terminate the application. Thus I try to install VS.Net 2003 on a Win2k machine and run my EXE from VS.Net IDE. The debugging outputs are attached below. Any clues / suggestions / solutions are appreciated. My program uses VS.Net 2003 (MFC 7.1, link as static library) and CImage class in that. The GDIPlus.dll is copied from .Net framework 1.1.3705. TIA, Arthur ...

How I can change the direction of Paste All in MS-Excel (MOST URGE
I am using Office 2003. I have copied some data from a word file in Office Clipboard. Now I want to paste this all data in MS-Excel. When I choose the "Paste All" option it pastes all data down side, while I want to paste the data right side / left side. How can I change it's pasting direction? I do not want to use "Transpose" option beacuse it is tadious & time consuming. I want to do this with a fasttest manner. How can I do this. Is it can be done by a macro? If yes then please tell me the macro code. It is Most Urgent so Please help me as soon as possible...

change an icon
I'm using XP Home. When saving an email in 'Message format' within one of my files, the envelope icon is too similar to the standard folder icon. Can I change the Outlook envelope icon for something else - what choices do I have and how can I do it so that the new icon becomes the default icon? > I'm using XP Home. When saving an email in 'Message format' within > one of my files, the envelope icon is too similar to the standard folder > icon. Can I change the Outlook envelope icon for something else - > what choices do I have and how can I do it so...