473,385 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ComboBox Notification Problems

Hello everyone and thank you for taking the time to read my post,

I have this code:

Expand|Select|Wrap|Line Numbers
  1.         case WM_COMMAND:
  2.            {
  3.               switch(LOWORD(wParam))
  4.               {
  5.                  case hwndCombo:
  6.                  {
  7.                     switch(HIWORD(wParam))
  8.                     {
  9.                        case CBN_DROPDOWN:
  10.                        {
  11.                           MessageBox(hwnd, "OK", "OK", MB_OK);
  12.                        } break;
  13.                     } break;
  14.                  } break;
  15.               } break;
  16.            } break;
  17.  
Also, I have hwndCombo initialized right after I create my window. Don't worry, I know it is initialized before WM_COMMAND runs:

Expand|Select|Wrap|Line Numbers
  1. wndCombo = GetDlgItem(hwnd, 30000);
My combobox resource is defined as 30000.





Anyways, when I try to compile this code I get this error:

Expand|Select|Wrap|Line Numbers
  1. `hwndCombo' cannot appear in a constant-expression
Thanks for any help given.
Jun 28 '07 #1
2 1287
Can I get any help on this one?
Jun 28 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
hwndCombo is being used as a case in a switch statement. Cases must be constant integer values.
Jun 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
2
by: John Tyce | last post by:
When a button is clicked, a date is inserted or added into a combo box like this : ComboBox.Items.Add(string) or ComboBox.Items.Insert(0,string); Either way, the new string does not show up in the...
1
by: zfeld | last post by:
I need an event notification when the user types anything in the combobox textfield? I know about the TextChanged Event but the problem is this is also fired when the user selects an item in the...
8
by: | last post by:
I am sure this has been asked and answered, but here goes anyway... VS.Net 2005, VB.Net How can you display more than one field in the displaymember property of a combobox inside the...
5
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I want to create a customized ComboBox where the methods ComboBox.Items.Add and ComboBox.Items.Insert will behave thusly: -- If the item is not present, add it. -- If the item is present, set the...
2
by: =?Utf-8?B?SmFtZXMgTWFydGlu?= | last post by:
I have a table that I dragged onto a form from a dataset. I changed some of the fields to comboboxes and set the data source, display member (text), and value member (int) to another table within...
2
by: =?Utf-8?B?V29ua28gdGhlIFNhbmU=?= | last post by:
Hello, I have a ComboBox that has a DataContext set on it. When a PropertyChanged event is fired (based on a static instance of some class), I'd like to update the DataContext on the combo, but...
6
by: Peter Larsen [CPH] | last post by:
Hi, How do i set DropDownWith in a asp.net ComboBox ?? Thank you in advance. BR Peter
3
by: =?Utf-8?B?V29ua28gdGhlIFNhbmU=?= | last post by:
Hello, I have a ComboBox with a style that sets its Template and ItemTemplate. I'd like to set the tooltip of the combo to the tooltip of the currently selected item, but I am having trouble...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.