|
m_combo.AddString("");
int x=m_combo.FindString(-1, "");
Is this behaviour ok?
rechi
|
|
|
|
|
what is the return code of AddString
is it adding the String, if yes the behavior is wrong!
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Yes, the string is added successfuly! Guess it's about a bug...
rechi
|
|
|
|
|
Bogdan Rechi wrote:
Is this behaviour ok?
It depends on definition of 'ok', I guess
Probably the combobox wndproc checks if string is empty in its CB_FINDSTRING handler and immediately returns CB_ERR if so. While this behavior seems reasonable for CB_FINDSTRING (because it's searching for item beginning with given string), it doesn't for CB_FINDSTRINGEXACT. CB_FINDSTRINGEXACT/CComboBox::FindStringExact also return -1 when you pass empty string.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Tomasz Sowinski wrote:
this behavior seems reasonable for CB_FINDSTRING
Don't believe it does. "" should be a prefix for every string in the list, in order to avoid loosing itself. It's the best way to implement FindString .
rechi
|
|
|
|
|
It wouldn't make any sense, since empty string satisfies CB_FINDSTRING search criteria for *all* items. Basically, it would return 0 if list is non-empty, -1 otherwise.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Tomasz Sowinski wrote:
It wouldn't make any sense
Yes, you're right!
So, it's all about CB_FINDSTRINGEXACT.
(don't tell me it's not, otherwise i will commit some and i don't think i deserve it)
rechi
|
|
|
|
|
I think it's definitely a bug with CB_FINDSTRINGEXACT returning -1 for empty search phrase. Of course, MS will tell you that 'this behavior is by design'
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Hi everyone.
I have Dialog based app with listbox on it.
In the second modal dialog i'm entering some data to editbox.
Can anybody show me how to add string with text from editbox(from modal dlg) to the lisbox on main dlg?
Thanks.
|
|
|
|
|
ok, object oriented way:
Write a function that takes a string and add it to ur listbox in the main dialo
Pass a pointer to the other dialog of ur main dialog and call the function
To pass the pointer u can do it when constructing the dialog as parameter to its constrctor, and there u cast it to the main dialog class pointer and store it in a member in the second dialog ( its type pointer to main dialog )
Hope this help
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Can I use standart:
CMainDlg:
CListBox list;
CModalDlg:
CMainDlg* mDl
mDl->list.AddString("blablabla");
?? such thing make no errors, but didn't work ...
|
|
|
|
|
You have at least two options:
1) The dialog with edit box has pointer listbox in parent dialog. It uses CListBox::AddString to add string
2) main dialog invokes secondary dialog with edit box. Secondary dialog maps string variable to edit box. When CEditDlg::DoModal returns IDOK, then main dialog adds string using CListBox::AddString
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Hi,
When I compiled and ran the sample code from DirectX 8.1 SDK Tutorial 1,
CreateDevice, I got a D3DERR_INVALIDCALL return value from CreateDevice()
and the sample app failed.
...
HRESULT hRst = g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &g_pd3dDevice );
...
I did copy the code from Platform SDK without any changes. And I am sure
that I have installed DirectX 8.1.
Is there anyone know what this error means? What should I do then? I am a
freshmen for DirectX SDK development.
Thanks for your help in advance.
|
|
|
|
|
D3DERR_INVALIDCALL
The method call is invalid. For example, a method's parameter may have an invalid value.
What is ur VGA card??
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Trident Video Accelerator 3D Image975
|
|
|
|
|
Hi..
Now i try to develop the application that can support both Chinese and standard english in one edit control
It is possible and how to implement it..
Thankz
;P ((
:_Rocket_:
|
|
|
|
|
|
::LoadImage
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Have you considered using http://www.codeproject.com/buttonctrl/cbuttonst.asp[^]
I think it is much better than CBitmapButton, especially when used in conjunction with LoadImage.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
hi folks,
I have an application which receives messages from mouse(by clicking on certain buttons)and keyboard(by typing key/key combinations).when i receive a message,is there a way by which i can know whether it has come from keyboard or mouse(many of the messages come from either of them)?
Help required urgently..
regards,
virajqw
|
|
|
|
|
How are you recieving them together ? Keyboard stuff comes from WM_CHAR, WM_KEYDOWN and WM_KEYUP. I think from memory the mouse ones are WM_LBUTTONUP, etc and WM_MOUSEMOVE.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
you can check MSG.message for detail
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Mouse messages have ids from WM_MOUSEFIRST..WM_MOUSELAST range. Keyboard messages fit into WM_KEYFIRST..WM_KEYLAST.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
hi,
Think i was not very clear about what i actually wanted.I know that WM_MOUSEFIRST..WM_MOUSELAST are from mouse and WM_KEYFIRST..WM_KEYLAST are from keyboard.But suppose there is an option in menu which can be selected through keyboard and mouse and the same option is available as a button on toolbar and i'm calling a common function after the option is selected,then how do i determine that the option was selected through keyboard or mouse.besides are these key and mouse events fired for accelerators as well?
thanx,
viraj
|
|
|
|
|
You can use wParam and lParam accompanying WM_COMMAND message to determine if it came from accelerator or menu. Have no idea about toolbar, however.
If you want to perform different actions for menu/toolbar/accel selection, why don't you assign different command IDs?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|