SendMessage function used to update combobox list

hello,
        I want to update the list of ComboBox control depending on the user 
values in the edit box.I need to use SendMessage() function to add string in 
the list with the type of message being CB_ADDSTRING(which is 2nd parameter 
in the function).The first is handle to the control/dialog where i want to 
insert the string.Can somebody please tell me how do i get handle to the 
combobox control?
help....
0
sayu (83)
7/26/2005 11:49:02 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
575 Views

Similar Articles

[PageSpeed] 6

"sayu" <sayu@discussions.microsoft.com> wrote in message
news:CEEC1C1E-3594-42A5-BA99-AEA7459E244E@microsoft.com...
> hello,
>         I want to update the list of ComboBox control depending on the
user
> values in the edit box.I need to use SendMessage() function to add string
in
> the list with the type of message being CB_ADDSTRING(which is 2nd
parameter
> in the function).The first is handle to the control/dialog where i want to
> insert the string.Can somebody please tell me how do i get handle to the
> combobox control?
> help....

See if GetDlgItem, SendDlgItemMessage answer this specific question. In an
MFC app you should seriously consider using a CComboBox control member
variable and calling its wrapper functions.-- 

Jeff Partch [VC++ MVP]


0
jeffp (1711)
7/26/2005 12:50:09 PM
If you are using MFC why are you using SendMessage?
Why not simply attach a CComboBox object to the control and use it's
methods.

class CMyWnd : public CWnd
{
.....
private:
    CComboBox m_MyCombo;
};

void CMyWnd::DoDataExchange(CDataExchange* pDX)
{
   CWnd::DoDataExchange(pDX);
   DDX_Control(pDX, IDC_COMBOBOX1, m_MyCombo);
}

void CMyWnd::FillComboBox()
{
    m_MyComboBox.AddString("This is an item");
}


AliR.

"sayu" <sayu@discussions.microsoft.com> wrote in message
news:CEEC1C1E-3594-42A5-BA99-AEA7459E244E@microsoft.com...
> hello,
>         I want to update the list of ComboBox control depending on the
user
> values in the edit box.I need to use SendMessage() function to add string
in
> the list with the type of message being CB_ADDSTRING(which is 2nd
parameter
> in the function).The first is handle to the control/dialog where i want to
> insert the string.Can somebody please tell me how do i get handle to the
> combobox control?
> help....
>


0
AliR3470 (3235)
7/26/2005 3:10:07 PM
Reply:

Similar Artilces:

Function In A Text Box
Hi, I am trying to put a concatenate function in a text box. The error message is as follows: The text you have entered is not a valid reference or defined name. I want to concatenate some text with a number from the cell, A2. Any ideas would greatly appreciated. Regards Tubbsy -- tubbsy ------------------------------------------------------------------------ tubbsy's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24743 View this thread: http://www.excelforum.com/showthread.php?threadid=388332 Its not a perfect solution but you could perform the concat...

Updating all Fields in Word Document
I need to update all fields in the Word document. I have some of the fields in drawing canvas too. I have tried this, which works fine, but except drawing canvas. http://word.tips.net/Pages/T003879_Updating_a_Field_in_a_Text_Box.html Thank you -- Regards Jan Kratochvil Windows Vista Business SP2, Office 2007 SP 2 Sub UpdateAllFields() Dim oStory As Range For Each oStory In ActiveDocument.StoryRanges oStory.Fields.Update If oStory.StoryType <> wdMainTextStory Then While Not (oStory.NextStoryRange Is Nothing) Set oStory = oStory.NextStoryRange ...

Watch this critical update which comes from Microsoft Corporation
--qidmykdc Content-Type: multipart/related; boundary="dvnrdjdetxoxjf"; type="multipart/alternative" --dvnrdjdetxoxjf Content-Type: multipart/alternative; boundary="nlqzswqi" --nlqzswqi Content-Type: text/plain Content-Transfer-Encoding: quoted-printable MS Consumer this is the latest version of security update, the "June 2004, Cumulative Patch" update which resolves all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three new vulnerabilities. Install now to help maintain the security of yo...

Should I Upgrade from 2000 to 2004 so I can use Pocket Money?
I currently use MS Money 2000 standard with no problems. I also have an iPaq 1945 that I'd like to use Pocket Money with, but can't since I'm using 2000 on the desktop. I have a paid copy of 2004 standard (came with new PC). Is it worth upgrading (converting the .mny file, having my bank 'upgrade' my profile to use online banking, etc.) to 2004 just so I can use Pocket Money and sync with my iPaq, which has Windows Mobile 2003? Any opinions? Is Pocket Money + desktop Money worth the hassle? Or, is Quicken + Pocket Quicken a better combination? I'd really l...

Import blocked sender lists
Outlook allows users to build a list of blocked senders. These lists can be exported to .txt file. Is there any way to import them into Exchanges blocked sender list? TIA Steve ...

How to get list of namespces ?
How to get list of namespces that are declared in an element ? -- Best regards, Oleg Subachev subachev@ural.ru "Oleg Subachev" <oleg@urvb.ru> wrote in message news:OU4HcHWdEHA.2376@tk2msftngp13.phx.gbl... > How to get list of namespces that are declared in an element ? Given that you have first positioned yourself onto an XmlElement of an XmlDocument, one of the fastest ways is to grab an XPath- Navigator and enumerate the Namespace nodes that are present. XPathNavigator nav = myElement.CreateNavigator( ); if ( nav.MoveToFirstNamespace( ) ) do { ...

How to select multiple sheets using macro
Hi, I want to select multiple sheets using macro in the runtime. I tried recording the action and it gave the following code: Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select Actually i want to copy all the sheets in the current workbook and move it to a new workbook.. Hence the next line would be: Sheets(Array("Sheet1", "Sheet2", "Sheet3")).copy.. which would copy the selected sheets to a new workbook.. Now the problem is, the sheet names mentioned in the code are fixed,, whereas i want to select the sheets dynamically in...

sendmessage
i have a dialog created with this code CreateEx(0, NULL, NULL, WS_POPUP|WS_VISIBLE, CRect(pt,CSize(0,0)), pParentWnd, nID); CRect Rect2(10,85,80,110); m_Close.Create("Close",WS_CHILD|WS_VISIBLE|BS_CENTER |BS_NOTIFY ,Rect2,this,IDC_CLOSE); // button CRect Rect(120,85,190,110); m_Open.Create("Open",WS_CHILD|WS_VISIBLE|BS_CENTER |BS_NOTIFY ,Rect,this,IDC_OPEN); // button when i click one of the two button i send massege with this code TBNOTIFY mm; mm.hdr.code = NM_CLICK; mm.hdr.hwndFrom = m_hWnd; mm.hdr.idFrom = GetDlgCtrlID(); mm.iItem = 2; mm.cchText = 5...

Need Help with Irregular IRR function
I am doing a big project for work that requires inputing a whole bunc of irregular cash inflows and outflows over a period of about 3 years. I tried ordering all the cash flows chronologically so that it woul look like: Date Cash Flow and the outflows were negative, inflows were positive. I thought I covered all the possible problems, but I was wrong becaus Excel kept telling me that when i selected all the values, (Cash Flo and/or date) I had an error because I was dividing by Zero. I trie taking out all the zero values for cash flow, but still I got the sam result. I didn't att...

There should be controls, edit lists, and approvals in BankRec
Without controls in the bank rec module I am forced to have a more senior person prepare all my reconciliations. Junior people can post transactions without approval and this significantly effects internal controls for the most liquid asset. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree&qu...

List/Numbering indent issue....
Hello... I am creating a document with numbering/list (i.e. 1., 2., 3.---) and also having images included using text wrap.... but when the images are inserted into the desired places the numbering/list makes an "extra long" space between the number and the text. I have right clicked and chosen adjust list indents and done every possible thing and it tends to change all of them and not getting me the results i need. I am editing text and documents for my boss for production and i need help fast. THX... Unfortunately, there has been an issue with indentation next to...

Help with custom search form
I have a search form that retrieves records in a subform based on criteria entered into unbound text boxes on the main/parent form. The subform is tied to a SQL recordset that contains a field called “Select”. The field’s datatype is Yes/No. On the main form I have a button called “View Selected” with the following code in the OnClick event: Private Sub cmdViewSelected_Click() On Error GoTo Err_cmdViewSelected_Click Dim i As Integer i = DCount("ProjectId", "ProjectTbl", "[Select] = " & True) If i = 0 Then MsgBox "No Record(s...

List view with no item selection
How could i do that Handle LVN_ITEMCHANGING notification. Before return assign value 1 to *pResult. "Mubashir Khan" wrote: > How could i do that > > > ...

Description of Statistical functions in Excel 2002
Hello, I am looking for the English description of the statistical functions in Excel 2002 Could some one mail me the text of this help file in a doc file or show me a website where this is shown? The Help function has a page with a listing and description of all the statistical functions. I hope someone can help me. Best regards, You can copy and paste the text from Help into Word. Jerry Erik Gerets wrote: > Hello, > > I am looking for the English description of the statistical functions in > Excel 2002 > > Could some one mail me the text of this help file in a d...

Excel Writeback functionality with SSAS
Hi, I am working on Excel 2010 writeback functionality with SSAS. Writeback functionality works when the cube is of small size. Writeback functionality fails when the cube is of have size say 50lakh records. I get an error as Data cannot be retrieved from external data source. Error Message written by the external data source Server: The operation has been cancelled. ...

How to use AND with "WHERE" in OpenForm... like (idA=Me.idA) and (idB=Me.idB)
How do you specify two conditions in the where clause in a DoCmd.OpenForm instruction ?? So the "Where part of.... DoCmd.OpenForm "AltForm_A" would look something like, , , "[idA] AND [idB] = " & (Me.idA) AND (Me.SubForm_B.idB) ----- Below is my simple setup ---- showing what I'm trying to do. 1 - I have 2 tables...tblA and tblB 2 - While looking at... MainForm_A with SubForm_B 3 - Double click on a record in SubForm_B 4 - and open AltForm_A with AltSubForm_B - a form with a different view of the same data Thanks for any help with this. Mel MyEmai...

Newsreader when using Outlook
I'm just transition to Outlook (from OE). Just wondering about news-readers. I use OE as a news-reader at the moment. But it's not apparent that that is possible in Outlook proper. If this is so - what are Outlook user's doing in this reagards? Many thanks. === Phil (NZ) You are in luck. OE is the news reader for Outlook. Always has been. Always will be. -- Russ Valentine [MVP-Outlook] "Phil Jones" <phil_newsgroup@hotmail.com> wrote in message news:%23lEn6sibFHA.2756@tk2msftngp13.phx.gbl... > I'm just transition to Outlook (from OE). > > Just...

Template functions, splitting
Dear people, (how) is it possible to split a template function[*] (member or global) so one can have the header in a .h file and the body in a .cpp file? More so if the function will be used in a different DLL, meaning that it is defined in DLL 1 and used in DLL 2? Every suggestion welcome, TIA! ----- [*] like: template<class T> vector<T> func(...) { .... } I may be wrong, but my understanding with C++ templates is that all the template code must be "inline", so you must put everything in header files. Giovanni "Frank" <jerk@gmx.de> ha scritto ne...

What formula to use?
User has two worksheets with names of employees for different years. She wants to compare the worksheets with each other to see if between the two years, anything has changed? Employees leaving, coming, etc. Which formula would help her? Thanks Hi, see CPearson web, go to the middle of the page look for Extracting Elements from One list not on another list http://www.cpearson.com/excel/ListFunctions.aspx if this helps please click yes thanks "Janet" wrote: > User has two worksheets with names of employees for different years. She > wants to compar...

Is Microsoft POS easy to use?
How is it compared to other POS systems? Thanks. I have not tried other POS systems, but if you want to know weather it's easy for other employees to learn, it's simple...you can read about it on the MS website regarding the system. It takes a while to set it up and all of that, as far as inventory goes etc, but as far as employees goes, it shouldn't really take more than a day for them to get the hang of it, and within a week they are pretty much pros at it. -- Thank You,; Vince "icanluv2@yahoo.com" wrote: > How is it compared to other POS systems? Thanks....

Q: use STL container across the dll boundary?
Hi, Can I use STL container across the dll boundary? I call a function in another dll and pass the reference of a set as a parameter. But the data read from the set in that dll is inconsistent with the data in the calling dll. Is there a MFC 6.0 container matching the STL's set? Please help me out. Thanks. Tony Tony Young wrote: > Hi, > > Can I use STL container across the dll boundary? I call a function in > another dll and pass the reference of a set as a parameter. But the > data read from the set in that dll is inconsistent with the data in the > call...

Address updates
Situation I have many contacts linked to an Account. So ... I get a new account address ... do I need to drill into each record and update each contact .... or is there a way to link them, or auto update related records Rhett ...

Exchange 2007 Global Address List
Dear Sirs, How to update Exchange 2007 Global Address List in EMC? Hugo Hi All I would like to mention something for yours. I am not able to update Global Address List when outlook client in cache mode. Would you please hrlp mne? Hugo "tknl" <tknl@yahoo.com> ���g��l��s�D:%23X0dtj89KHA.5476@TK2MSFTNGP06.phx.gbl... > Dear Sirs, > > How to update Exchange 2007 Global Address List in EMC? > > Hugo > On Thu, 20 May 2010 13:59:38 +0800, "tknl" <tknl@yahoo.com> wrote: >Hi All > > > ...

function for Column Position
Simply trying to modify equations (in columns) where long equation covers column letter. Currently using row to designate column by hand, but when cut-paste columns run into problems, just need to have same column Letter Position re-displayed. Thanks...... currently have: =CELL("COL",A67) gets a number, need column letter re-displayed also: not familiar with arrays or vlookup, if answer & you have subject info links Thanks!.... -Nastech I don't quite get what you're doing, but you could use: nastech wrote: > > Simply trying to modify equations (in...

Should I install updates before run migration wizard?
Hi, SBS 2008 is installed on migration mode. I disable update services on source server, when install 2008, there is option if you want to installed updates, I selected yes because it is recommanded. After the install is done, I got error that updates failed. I checked the updates history, there is only sharepoint service pack installed during the installation. So I manually run Windows updates, it keeps telling me window is up to date. What should I do now? Will this error affect migration later? Need help! Thanks in advance! Lisa I think you'll get better answer...