|
|
Overriding PreTranslateMessage() is one way to do it (I have assumed a few things, since you did not provide enough information). But, what you are in need of, may be different. Why do you want to trap the Esc Key?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I think that you want to avoid closing the dialog when the user hits the escape key.
BOOL MyDlgClass::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message==WM_KEYDOWN)
{
if(pMsg->wParam==VK_RETURN || pMsg->wParam==VK_ESCAPE)
pMsg->wParam=NULL ;
}
return CDialog::PreTranslateMessage(pMsg);
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Are you wanting to keep from dismissing the dialog, or are you wanting to trap the ESC key for something else?
"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
|
|
|
|
|
When I am adding a function, that needs to be exported to dll, in the header section... I get the following. Please tell me how to resolve this.
error C2146: syntax error : missing ';' before identifier 'Set_file_path'
fatal error C1004: unexpected end of file found
Following is what I am adding..
string Set_file_path( string &Right_str);
I have also included "#include <string>" before this
THanks...
|
|
|
|
|
what about adding this :
using std namespace;
after
#include <string>
or use the std:: before all string members and types ?
|
|
|
|
|
That Doesnt workout. I tried doing that too.
|
|
|
|
|
I suspect what you're looking for is :-
#include <string>
using namespace std;
string Set_file_path( string& Right_str );
If not then you'll probably need to post the whole header of your file.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
No that doesnt work eithr. Wat about posting the whole header. How I do that
|
|
|
|
|
Just paste it into your message between <pre> and </pre> tags, just the text up to the point where the compiler throws a wobbly.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Hi,
I am using VC++ 6.0. in Windows 2000
Is the following code related to Environment of the system?
hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_SINGLEUSE);
_ASSERTE(SUCCEEDED(hRes));
I am getting the following error in most of the system.. but working fine with some other system which is having same configureation.... (VC++ 6.0 in Windows 2000)
Debug Assertion Failed!
Expression: SUCCEEDED(hRes)
Do I need to update Registry file or anything??
Plz Help !!
Thx,
wilfred.
|
|
|
|
|
You need to determine the value of hRes to find out which error occured when you called _Module.RegisterClassObjects . You might need greater administratve privelleges to register your server or there could be one of a number of other errors.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
I have Admin privilege...
Let me find out wat is the value in hRes..
Thx...
|
|
|
|
|
I have an application which is converted from VC6 to VC7.1 (.net 2003)
I'm trying to debug in .net 2003 i need to check the return value HRESULT value. I have declared hr as
HRESULT hr = S_OK;
When i add "hr" in watch window it displays a message CXX0017: Error: symbol "hr" not found
When i try to set the cursor on HRESULT hr = S_OK line (using Set Next Statement) it does not execute that line.
Could you please let me know what could be the reason? and why cant i see the hr value.
Thanks
|
|
|
|
|
Are you sure you are running the debug build.
|
|
|
|
|
It sounds like you need to rebuild the project, the changes are probably not in the debug executable or .pdb file yet from what you describe. A rebuild should take care of it and let you set a break point on your new line.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
I tried rebuilding the project but still can't get it work, by the way i'm debugging the application in Release mode, is there any other setting required for Release build?
|
|
|
|
|
If you're going to debug the Relese build then you need to make sure the Release build is set to contain Debug information and that it's the one actually being started in your debug session. If you've got problems debugging I'd recommend debugging with the debug build at least to start with until you're certain what's going on. The only reason to debug the Release build is generally if you get a 'works in Debug but not Release' problem. If that's what you've got then there's a good article on CP somewhere about what to do, unfortunately I don't have a direct link on hand.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
I am parsing a file line by line using getline, but not able to get rid of the blank line in it. Please help me out....
Following is the code snippet..
while(file)
{
if(getline(file,line))
{
if (line.find('#')||line.find(""))
{continue;}
else
{
length = line.find("=");
if(length != string::npos)
{
Left.assign(line, 0, line.find("="));
Right.assign(line, length+1, line.size());
}
cout<<Left<<":"<<Right<<endl;
}}}
|
|
|
|
|
#include <iostream>
#include <string>
#include <algorithm>
#include <fstream>
using namespace std;
bool IsNotBlankSpace(char ch)
{
if (ch == ' ' || ch == '\t')
{
return false;
}
return true;
}
inline bool IsBlankLine(string &rstrLine)
{
return rstrLine.end( ) == find_if(rstrLine.begin( ),
rstrLine.end( ), &IsNotBlankSpace);
}
void main ()
{
ifstream fileProps("C:\\properties.txt");
string strLine;
while (!fileProps.eof())
{
getline(fileProps, strLine);
if (IsBlankLine(strLine))
{
cout << "Blank Line" << endl;
}
else
{
cout << strLine << endl;
}
}
}
|
|
|
|
|
Hello all,
I am developing sniffer kind of application.
I have it at all. But now i want to add IP Filtering option in it.
But i don't know how to set an option on socket so that i can not receive local network packets.
Is there any body who can help me out.
Any help will be highly appreciated.
Thanks in advance.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
Are you wanting to sniff on the packets that originated from an external network? In that case, you could do a check on the source IP address of the packet, which should not belong to the IP range of your local network.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hello all,
I am using webBrowser control for my application. In fact i am trying to build customised browser application. I am able to navigate to any URL using CHtmlView::Navigate method. But not to the URL containing swf file in their url string just like below:
http://www.webkinz.com/SWF/setLocale.swf?locale=us_en[^]
Above URL gives me IE script error. When i disabled IE Debugging script option in IE's Internet Options Advanced tab, I can navigate to above URL.
But what I want is that is there any other way to accomplish this task. I don't want to do it manually.
|
|
|
|
|
|
Hi,
Is there any API that can tell the file position inside the File System like cluster number,sectornumber,etc?
Means at which clusters the file is located.
|
|
|
|