|
You can add the OnCancel and insteads of return CDialog::OnCancel (); just use an empty return;
Maybe is not the best option but it should work. Other possibility should be to intercept the message loop, but I don't know for sure how to do it correctly, sorry.
Regards.
--------
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
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
now it is not close even with close button or close option from system menu.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
If you just want to disable the Escape button, then do it in the PreTranslateMessage() . See sample below. Now your escape keydown will not be processed. So it won't affect the behavior of cancel and close buttons.
BOOL CDialogDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && (pMsg->wParam == VK_ESCAPE ))
{
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thats what I meant. Thanks for the answer.
Regards.
--------
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
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
|
Hello all,
I have requirement of encrypting a string in VC++ and decrypting it in ASP. so how could i accomplish this task.??
Please help me out in this situation.
Thanks & Regards,
Hemang
|
|
|
|
|
You can use crypto++ for encryption in C++. For decrypting in ASP...well ask in ASP forum
-Saurabh
|
|
|
|
|
|
Hi Friends
How to get count of columns in a CListCtrl
-RisKhan-
|
|
|
|
|
Use Header Control of CListCtrl.
For Example:
CListCtrl* pmyListCtrl;
int nColumnCount = pmyListCtrl->GetHeaderCtrl()->GetItemCount();
Mukesh Kumar
Software Engineer
|
|
|
|
|
|
And see Using the List Control[^] Matt Weagle wrote:"Everything you need to know about using the standard list control in your applications".
|
|
|
|
|
Hi all,
How can focused on ListCtrl at the time of Tabstop.
Thanks
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
When i m using Tabstop property of controls,then the cursor go to the next control on the clicking of Tab Key.
Cursor go to on all Controls like EditBox,CheckBox,Radio Button,Button etc,but the cursor not come on ListCtrl.
So plz tell me when i press the TabKey how can i focus on ListCtrl.
Thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Good day for all.
I am a beginner in VC++. I have a question about the remote shutdown of the computers in local area network.
Server and clients are connected using WinSock - Simple Chat.
Have i a way to shutdown this computer woithout creating COM-objects ?
|
|
|
|
|
|
hi, is it possible to load a txt-file into the combobox list?
any suggestions on how to do this easy..
tanx
EDIT: nevermind, i found some working code to load csv files into combos dropdown..
modified on Saturday, June 7, 2008 8:17 AM
|
|
|
|
|
Text file in ComboBox????????????
-@SuDhIrKuMaR@-
|
|
|
|
|
yes, to load a list from a text-file into the combobox drop down list.
some code to load the file and split it with commas or something,
and then somthing like:
m_myComboCtrl.AddString(1rstLineInFile);
m_myComboCtrl.AddString(2ndLineInFile);
and so on.
|
|
|
|
|
Yes its possible but you dont use of Editbox or ListBox or ListCtrl?
|
|
|
|
|
I am doin the following...
Class A
{
public:
void out_func1();
class B
{
public:
string path;
in_func1();
};
};
How do I use the value of path in 'out_func1()'??
I tried ...
void A::out_func1()
{
B obj;
obj.path;
ofstream myfile;
myfile.open (obj.path.c_str(), ios::app);
...
}
This causes problem during runtime and the program crashes
Please let me know how to rectify this.
THANKS.
|
|
|
|
|
It seems you are using it correctly except that you are not setting the file path so the IO to the file will fail. Are you sure program is crashing in this function? Have you actually debugged to see where is the crash?
-Saurabh
|
|
|
|
|
Well, since you haven't initialized the obj.path variable, not wonder if the application doesn't behave correctly.
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
|
|
|
|
|
I am sorry. This is how it is...
My Class is defined in newclass.h as...
Class A
{
public:
void out_func1();
void out_func2();
class B
{
public:
string path;
in_func1();
};
};
I then Get the path at intialize.cpp as follows....
void A::out_func1()
{
B obj;
obj.path="c:\folder\file1.txt";
}
Then I try to open the file to write in write.cpp...
void A::out_func2()
{
B obj;
ofstream myfile;
myfile.open (obj.path.c_str(), ios::app);
...
}
This crashes.I have included the header initialise.h too.
Please let me know were I could have gone wrong. I think I am having problem with the scope of the varible. But I am not sure.
THANKS.
|
|
|
|