|
You can map the LBUTTONCLICK message of OK and Cancel buttons. and comment the code CDialog::OnOK() and CDialog::OnCancel(). Then when you hit the key 'Enter' and 'Escape' the dialog does not will be colsed.
|
|
|
|
|
Kiran Satish wrote: I want to replicate tab behavior when I hit 'Enter' key
Hope this helps:
BOOL CTrialDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->wParam == VK_RETURN)
pMsg->wParam = VK_TAB;
return CDialog::PreTranslateMessage(pMsg);
}
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
You would need to check 'pMsg->message == WM_KEYDOWN'
God bless,
Ernest Laurentin
modified on Tuesday, May 6, 2008 11:57 AM
|
|
|
|
|
Ernest Laurentin wrote: You would need to check 'pMsg->message == WM_KEYDOWN'
Really? You mean - like, what I provided won't work? Did you even try the code before complaining anything?
A 'C++' question asked in the Visual C++ forum:
Title: please stomuch me
if i have
string s[7];
s[1]="hello"
...
s[7]="how are you"
can i trace s[1] by loop and select specified item as example i, want to select e from s[1]="hello"..... the question is : this process possible or impossible!? I hope help me.......thanks - sofia_111
|
|
|
|
|
Another option but not so "pretty" is to use a "bypass". You can use bools that determine which edit box has the focus by setting TRUE in OnEditBoxSetFocus and FALSE in OnEditBoxKillFocus. Then in your OnOk or OnCancel messages (when you press Enter or Cancel) ask for that bools. If no edit box has focus then close dialog, if one of them has it, then process its content and exit the function with a simple return, not the return from CDialog.
It is not a profi way, I know, but works :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Sorry, I didn't read your question correctly first time around...
Here...hope that helps, override your pretranslate message
BOOL CDelme1Dlg::PreTranslateMessage(MSG* pMsg)
{
if ( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN )
{
CWnd* pWnd = GetFocus();
if ( pWnd )
{
TCHAR szClass[32];
GetClassName(pWnd->m_hWnd, szClass, 32);
if ( _tcsicmp(_T("Edit"), szClass) == 0 )
{
this->NextDlgCtrl();
return FALSE;
}
}
}
return CDialog::PreTranslateMessage(pMsg);
}
God bless,
Ernest Laurentin
|
|
|
|
|
Hi,
I am having this error come up when I am running some software that was written in Visual C++ 6.0. I searched online and everyone says to install MDAC and the problem will dissappear, but I am still experiencing it.
Does anyone know what else I need to do to fix this problem
Thanks
|
|
|
|
|
godspeed123 wrote: I am having this error come up when I am running some software that was written in Visual C++ 6.0.
Did you write it? When did the problem first appear? What have you discovered using the debugger?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I actually didnt write this software, but it happens I think when it is creating a report, so it has something to do with a database, or something along the line of that.
|
|
|
|
|
So start debugging from that point.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Dear Friends,
I m working on an aplication which is using Oracle as a backend. I need to sync the time between Oracle server and my machine using some oracle defined function. Actualy i m not very familiar with how Oracle supports for this time sync.
Can anybody help me out with this?
Thanks in Advance..
If u need any more input to answer please let me know
Megha
|
|
|
|
|
I dunno about any built-in functions for Oracle (or any other DBMS for that matter), but if you cannot get the systems to sync to each other in the usual ways, your application can execute some SQL that returns the date/time on the server and you can sync the local PC's time to it.
Not perfect, kludgly as hell, but when in a pinch...
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thank you so much James.
Could u plz tell me how can we set system time?
|
|
|
|
|
megha_gharote wrote: set system time
SetSystemTime()[^]
BTW, why don't you do a little Google search before asking a question? Just a suggestion.
A 'C++' question asked in the Visual C++ forum:
Title: please stomuch me
if i have
string s[7];
s[1]="hello"
...
s[7]="how are you"
can i trace s[1] by loop and select specified item as example i, want to select e from s[1]="hello"..... the question is : this process possible or impossible!? I hope help me.......thanks - sofia_111
|
|
|
|
|
You can get the SYSDATE from the Oracle server and that will give you the date and time. Set your local PC time according to the time returned from the query.
|
|
|
|
|
I converted a console app into an NT service.
Is there a way to determine in the main if my app was called from SCM or because user double clicked on the AppName.exe ?
|
|
|
|
|
Your ServiceMain(...) callback can set a flag which indicates SCM involvement.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hello all,
What is the fastest way to get an url's source code?
I tried to use CHttpFile class, but it is very slow,
is there any way to get faster url's sourse code?
thanks for advance
It is never late to learn
|
|
|
|
|
Gofur Halmurat wrote: I tried to use CHttpFile class, but it is very slow,
is there any way to get faster url's sourse code?
use direct API, but is surly depend on your network speed!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Thanks for reply:
What is direct Api?
It is never late to learn
|
|
|
|
|
ohh sorry I chewed the word before writing it here .. i ama talking about Internet api's. you could try this application, see it might be helpful :-
http://www.codeproject.com/KB/IP/amhttputils.aspx[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Have you tried URLDownloadToFile() ?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i have a simple dialog based program which uses this control.
http://www.codeproject.com/KB/list/sortlistctrl.aspx[^]
A member variable of CSrtList type is also defined.
I use a button on the main dialog which opens a new dialog (with domodal) and all items of every row of the sortlist control is filled in some sections. At last I want to use this command:
m_ctlList.AddItem( _T("Mark Jackson"), _T("09/08/1974"), _T("100") );
but it says the m_ctList is undeclared. I tried to use it as an external variable but no success!
|
|
|
|
|
Why don't you re-post it again? We all are waiting for.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Why don't you re-post it again? We all are waiting for.
Patience! Stop jumping up and down. Can't you see others are waiting as well? He's busy creating another user id and he'll post it ASAP. After all, it's an urgent query, you see.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|