|
Hi all
I am making a dialog based application.
Now when we press "Esc" button then dialog is closed.
Now I want to stop this activity that is if press Esc button then dialog should not be closed.
Please help ( better if provide some code snippet for implementing this)
Thanks
|
|
|
|
|
delete the CDialod::OnCancel()function in OnCancel().
-- modified at 1:53 Saturday 1st July, 2006
|
|
|
|
|
Open your application class Say Check1App and override PreTranslateMessage in this class.
Add this code to the PreTranslateMessage function.
if(pMsg->message == WM_KEYDOWN && (VK_ESCAPE == pMsg->wParam || VK_RETURN == pMsg->wParam))
pMsg->wParam=VK_SEPARATOR;
return CWinApp::PreTranslateMessage(pMsg);
I hope this will solve your problem
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
how we search the file in the system.i mean i have file name and i wnat to serch that file in system.
sree.
|
|
|
|
|
Hi happy_ram!
We can use CFileFind class for serch file.
For example:
CFileFind finder;
BOOL bWorking = finder.FindFile("C:\\*.*");
while (bWorking)
{
bWorking = finder.FindNextFile();
cout << (LPCTSTR) finder.GetFileName() << endl;
}
|
|
|
|
|
if i want to search the file in totally system not c or d for search for total system.
|
|
|
|
|
In additinal you can use FindFirstFile/FindNextFile
whitesky
|
|
|
|
|
You can use GetLogicalDriveStrings() to get the logical drives and then proceed on to find the file as suggested above.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
just show me a small example to understand the function more cleraly
|
|
|
|
|
int iStrsLen;
char drives[105];
char szDrive [4];
iStrsLen = GetLogicalDriveStrings (sizeof(drives), drives);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
not sure if this is the right section, but how can i hack my own account in a game called battlefield- i give myself alot of points but they dont get added, rather, their added and then the game crashes
|
|
|
|
|
Robertbobby91 wrote: not sure if this is the right section
wrong section
nave
|
|
|
|
|
i dont believe there IS a section for that here lol
rara avis in terris
|
|
|
|
|
people are respectable on CP buddy...
go die for crack looser
-- TTD --
|
|
|
|
|
wat do u mean, how am i disrespectfull? all im asking for is a little programing help to aid me in a video game
|
|
|
|
|
The software you have installed in your computer is only physically yours. Intelectually, it probably is not (depending on who developed the game).
This means that it is probably illegal for you to hack into files, which may result in the exposure of intelectual property rights of the game developer. The money, time, and effort that they spent on the game are probably theirs to keep, and they have the right to demand that you do not learn anything from it (either for yourself or others) nor change it in anyway.
So, they will probably not authorize someone like you or I to hack into the databases, change the code, and eventually sell a solution for hacking the game. Even if that is not your intention they have the right to demand that you don't even get close. And other similar things, like hacking into the executables and changing the names in the credits section is probably not authorized as well.
You show disrespect by not recognizing that you do not have permission to even look inside those files unless the game developper explicitly states otherwise. You do not have this right even if it is so easy for you to open the files. You show disrespect by not recognizing that there may be great effort, time, and money invested in it that gives them the right to say what things you should not be allowed to do. If you go ahead and do it without permission then you will be probably commiting a crime.
People often get confused of their rights because it is very easy to access protected material. It is easy to download MP3 or DVD from the WEB, but that doesn't make it legal or respectable. The same applies to software: it is rather easy to reverse engineer high-cost pieces of software and re-brand them or re-sell them, or even just come to know how they were made, but thet doesn't make it respectable or legal.
Rilhas
|
|
|
|
|
i see, but u play the game, u'll see how much "time and effort" the developers put into it but anyways, its perfectly fine to me, im having fun learning how code works, besides, wat do i gain by making myself invincible on a video game, it just makes the game boring and makes me either buy more of their games,our actually find the time th get some phis-phis-physical activity
|
|
|
|
|
how can i search a record in a database, the fastest way without inheriting the CRecordset class... Can you please show me an example of it...
-----------------------------Life is simple, you just complicate things---------------------------
|
|
|
|
|
The best way to search a database is to actually use the database to execute SQL commands.
Although with that said no one give you the answer you want unless you give at least some details on what you are trying.
John
|
|
|
|
|
the problem with executing sql commands is that it dont return a value. for example if im trying to retrieve the data of a particular record. do you have methods of doing it.
----------------------------Life is simple, you just complicate things---------------------------
|
|
|
|
|
AFAIK you put the same question many times last days.
One answer with exampe code, using MFC class CRecordset directly without inheriting, I gave you HERE[^].
What's the problem? Doesn't work? Hard to read? Looks ugly? Not enough speedy?
Have you even tried it?
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
yes you have given me that code before, and i thank you for that... But i need speed now... and you use the forwardOnly attribute, which means i have no bi-directional scrolling... and if the database has 400 records it would take a time to get to the end...
--------------------------------Life is simple, you just complicate things--------------------------------
|
|
|
|
|
Life is simple, you just complicate things...
Well, I have used forwardOnly in my example just as an example and it's not intended to be copy/pasted.
Put what you wish instead. Is that a problem?
Although 400 records are not so much in real programming world, if you want a little bit more speed, use ADO instead of MFC database classes.
And if you really really need much more speed use the database native C APIs (if any available).
HERE[^] is an example of MFC wrapper classes built around MySQL C APIs. Very very speedy...
If you are using another database than MySQL, sorry but I have nothing available for the moment. You have to dig yourself for the sake of speed.
BTW. Are you really, really need "bi-directional scrolling" for your recordset?
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
yes i kinda need it very much... so i could easily navigate through my database... thanks my question is answered
----------------------------------Life is simple, you just complicate things----------------------------------
|
|
|
|