|
I'm just trying to check out the basic functionality of a combobox. I thought that with the code above< I could enter something, then dropdown the box and see it in the list...
Appreciate your help,
ns
|
|
|
|
|
Its probably due to the if(pMsg->) else condition. you should just miss this section out of the function.
BOOL CCombobox1View::PreTranslateMessage(MSG* pMsg)
{
CString s;
if ( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN )
{
if (GetFocus() ==& m_combo1)
{
m_combo1.GetWindowText(s);
m_combo1.InsertString(0,s);
m_combo1.SetWindowText("");
m_combo1.SetFocus();
}
else
{
}
}
return CFormView::PreTranslateMessage(pMsg);
}
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Modifying the UI in PreTranslateMessage may be unsafe. I guess you should move the presented functionality to OnKeyDown (WM_KEYDOWN handler). Additionally, to make OnKeyDown being called for VK_RETURN, you should override OnGetDlgCode (WM_GETDLGCODE handler) to return DLGC_WANTALLKEYS constant.
Regards,
Bartosz Bien
|
|
|
|
|
My Cdialog has two CEdits. THe default ONOK has no code in it (I'm trying to prevent enter from killing the dialog), THe way things are, the Done button has third tab order (after the CEDits) and does an EndDialog. For some reason, Enter is dismissing the dialog even though the default ONOK is empty. I need to prevent this behavior, but the standard method is not working. I even made a label be third tab order just in case.But the enter still dismisses the dialog ?This has worked before (emptying OnOK) but this time it isnt and I dont know why..
Appreciate your help,
ns
|
|
|
|
|
PreTranslateMessage
search this forum for it.
-c
No matter how fast light travels it finds the darkness has always got there first, and is waiting for it.
-- Terry Pratchett,
|
|
|
|
|
Thats what I ended up doing...I had saved a link to it...
Appreciate your help,
ns
|
|
|
|
|
Hi
I'm not sure whether it will help but try it. Do not delete default ONOK handler. If I remember well there should be line with OnOk() or something like this. Comment this line.
Greetings
Mariusz Popiolek
|
|
|
|
|
I didnt delete it. I just commented out that base class calll like you said...
Appreciate your help,
ns
|
|
|
|
|
And what? Did it help? (I suppose not )
Greetings
Mariusz Popiolek
|
|
|
|
|
Nope> But I've used Pretranslate message and thats okay for the moment....so thanks for the interest..
Appreciate your help,
ns
|
|
|
|
|
Now I tried this in VC to be sure . I double-clicked ok button so I obtain such autogenerated code:
void CMy123testappDlg::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
}
And after commenting CDialog::OnOK(); pressing Ok button does nothing! (dialog doesn't close). So it must help, or maybe we have a little misunderstanding (maybe your problem is a bit different).
Greetings
Mariusz Popiolek
|
|
|
|
|
I agree that pressing the OK after commenting out the line is unresponsive. I'm however hitting the enter key. Its probably got something to do with my tab order, but I only have two CEdits and 1 OK, 1 cancel to organize.....
Appreciate your help,
ns
|
|
|
|
|
Maybe you have screwed something. As far as I know hitting enter key and pressing the button using the mouse does exactly the same (launch BN_CLICKED handler). I don't think that tab order has something to do here. Handling this by messing with PreTranslateMessage is not quite elegant, my solution should work, just try to find the bug (easy to say I know)
greetings
Mariusz Popiolek
|
|
|
|
|
pretranslatemseeage is cool cos u can prevent the esc key closing ur dialog too if u want
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
One standard way I use to stop the OK button closing the dialog unless it has the focus is:
void CMyDialog::OnOK()
{
if (GetFocus() == GetDlgItem(IDOK))
EndDialog(IDOK) ;
}
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Thats a great trick! Thank you so much! This does mean however , that the ok button HAS to be pressed to exit, right? I wanted Enter to exit me too, but only if I had written into an CEdit...
But your solution looks good, so thank you very much!
Appreciate your help,
ns
|
|
|
|
|
Does anyone know how to add features to an existing control panel applet? I am writing a program that includes features closely tied with the properties of the Telephone applet of windows, and I would like to add to the property sheet or append a dialog to the existing dialog. Any idea how I might approach this problem?
|
|
|
|
|
The Telephony applet (Phone/Modem options) is controlled via TAPI.
The function lineTranslateDialog is used to display this dialog in your own application. It is possible to add custom pages via the TSPI for a telephony device.
From MSDN
Assume for the purposes of an example that the application calls the TAPI lineConfigDialog function, which is designed to open a dialog box to allow configuration of service provider options related to the specified line device. In response to this call, TAPI requests TAPISRV to call TSPI_providerUIIdentify in the telephony service provider, obtaining the name of the TSP UI DLL.
In the application's context, TAPI loads the TSP UI DLL and calls the TUISPI_lineConfigDialog function with the parameters supplied by the application, and including a pointer to the TAPI TUISPIDLLCALLBACK function. The TSP UI DLL displays the configuration dialog box, calling the TUISPIDLLCALLBACK function as necessary to obtain from the telephony service provider the information to display. Each time the TUISPIDLLCALLBACK function is called, TAPI requests TAPISRV to call the telephony service provider's TSPI_providerGenericDialogData function, passing in the parameter block from the UI DLL, and returning the parameter block to the UI DLL. The UI DLL conveys any configuration changes to the telephony service provider by calling TUISPIDLLCALLBACK.
When the function is complete, the UI DLL returns from (in this case) TUISPI_lineConfigDialog. TAPI calls the Win32 FreeLibrary function to release the UI DLL, and returns to the application.
Michael
"I've died for a living in the movies and tv.
But the hardest thing I'll ever do is watch my leading ladies,
Kiss some other guy while I'm bandaging my knee."
-- The Unknown Stuntman
|
|
|
|
|
Thanks Michael! I'll have to study it for a while before I can tell if it would be useful to me. Can you tell me where the MSDN article comes from and where I might find other resources or the sort? thanks!
-Leo
http://LessExpense.tripod.com
|
|
|
|
|
Its under the Telephony Application Programming Interface on the Platform SDK.
There is a section called TAPI Service providers and a sub section of The Telephony Service Provider UI DLL Interace.
Michael
"I've died for a living in the movies and tv.
But the hardest thing I'll ever do is watch my leading ladies,
Kiss some other guy while I'm bandaging my knee."
-- The Unknown Stuntman
|
|
|
|
|
Hi,
I'm trying to compile a game from a textbook, and I get this link error:
libcd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
This is supposed to mean that the VC-6.0 file libcd.lib erroneously uses the symbol _main which of course seems extremely unlikely.
If I compile a Release version I get the same error but now against libc.lib.
I'm using VC 6.0 under Windows 98. The program uses directX and I put the proper libraries on the link list. Also, I copied in the author's code, so it's not a typo.
I think I must have some compiler/linker setting wrong. Any ideas?
Al
|
|
|
|
|
The libcd.lib is the debug version of the C-runtime and the libc.lib is the release version. The C-runtime library expects that main() function to be present as the entry point to your application. When your program gets started up, the C-runtime will first be initialized, then it will forward execution to main so that your program can start running.
Check in your project settings, under the C++ tab. If ATL is used in this Demo and _ATL_MIN_CRT is defined, that would cause this problem.
If that does not solve your problem, what kind of application is it. Does it use ATL, MFC or straight WIN32 API? This information would be useful in helping you solve your problem.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
You need /subsystem:windows in the link command.
Chances are, that will cause other error messages though. You may want to use the App Wizard to create an empty Win32 application, then add your source files to the project.
--------
There are 10 types of people in this world. Those who know binary and those who don't.
|
|
|
|
|
I'm creating and populating a database with ADO and ADOX. Now the very first time I do this and create a brand new database, things are fine. If I try to overwrite an existing database, I get "permission denied" . I close the database when I exit, so that should be fine. Any ideas at what I should look at here? Its an access database with one table.
Appreciate your help,
ns
|
|
|
|
|
If you want to create a database with ADOX and the database exists, First you need to delete the file, then you must to create the database..
Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|