|
so you mean I should do this? But it seems that the key can't get response from the dialog still.
extern HWND hwnddlg;
int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst, LPSTR lpszCmdLine, int nCmdShow)
{
...
while (GetMessage(&msg, NULL, 0, 0)) {
//TranslateMessage(&msg);
IsDialogMessage(hwnddlg,&msg);
//DispatchMessage(&msg);
}
return (msg.wParam);
}
|
|
|
|
|
You are right, it's not enough; the 'A' is stolen by the control that actually has the focus in the dialog box.
You could fix it by subclassing the controls able to gain the focus or you could create a hidden button with 'A' as mnemonic key.
rechi
|
|
|
|
|
"Hidden button with 'A' as mnemonic key": So clever an solution!!
so by "mnemonic" you mean that I should define a so-called "acceleration key"?
But how to define acceleration key to a button in a dialog? can you explain more? I only know the acceleration key to a menu in the main window--a newbie of windows programming.
Thank you.
|
|
|
|
|
Just type & before the key you want to use as mnemonic for that button.
For example: Butt& on will have the o key as mnemonic.
rechi
|
|
|
|
|
thanks. I am using the studio.net. How to add mnemonic? In the property session, there is no such choice to add/change mnemonic.
Can I add an (text) accelorator description in my .rc file like this?
Exper_Menu ACCELORATORS
{
"1" IDC_FIRST
"2" IDC_SECOND
}
Thanks
|
|
|
|
|
Great, I got it, following your advice and online help.
I appreciate!!
|
|
|
|
|
I have some text and I would like to draw a black outline around it. How does one do this? Do I use pens or do I use another font with differant attributes?
I tried the latter and I got weird results.
Could someone please help!
Cheers,
Cline
|
|
|
|
|
I can't even spell my name
Cheers,
Clint
|
|
|
|
|
I have a C++ client app. that will be used publically within and outside the U.S. What type of encryption can be used to encrypt the packets between the client and server(Win2000)?
|
|
|
|
|
i think 54-bit DES or lower is OK. but, even then, i think you will have to ask the US Dept of Defense. last i checked (a couple of years ago) every application needs to be approved individually.
maybe Bush relaxed the rules on crypto ...
;P
-c
I'm not the droid you're looking for.
|
|
|
|
|
I was thinking of using the Rijndael (symmetric block cipher) for packet encryption. Am I right in thinking that I have to use something like RSA(public key) to transmit the key to the client at the start of the session since symetric cyphers require the same key at both ends?
Couldn't find any examples of this on CP.
|
|
|
|
|
Yes, you will need to use some sort of public key encryption to securely pass the session keys between the server and the client.
Then you can use the symetric encryption between the two.
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!
|
|
|
|
|
I remembered seeing an article on Rijndael encryption a couple weeks ago here on CP:
http://www.codeproject.com/cpp/aes.asp[^]
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
I am spawning a CDialog from an MFC MDI view.
I am presuming that I will put in stuff (RECT rcNormalPosition ) from the struct in the registry when I shut off the app:
typedef struct tagWINDOWPLACEMENT {
UINT length;
UINT flags;
UINT showCmd;
POINT ptMinPosition;
POINT ptMaxPosition;
RECT rcNormalPosition;
} WINDOWPLACEMENT;
Q1. I am not clear about what to store in ptMinPosition, and the corresp. maxpos. CAn I leave these NULL?
When I run the app gain, I want this CDialog excatly where it was and same size etc when I last shut down the app.
Q2. So in what part of the MFC code shall I make the CDialog show up again
( I'll do pDlg->Create() and then MoveWindow to rcNormalPosition ....correct? )
THese CDialogs are not within the mainframe....so will rcNormalPosition put them at those positions from the
computer screen origin? I'll have several CDialogs and I need them to reappear at the precise positions the user chose before he quit.
Appreciate your help,
ns
|
|
|
|
|
Check out this[^] article of mine. In particular, you can use the PlacementHook[^] class to easily accomplish what you need.
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
I am optimistic I'll be able to figure out your class and use it<> only question is this:
The CDialogs were spawned by an MFC MDI view menu. SO now when the app is rerun, its the MDi part that will be running. I was reading the registry in pre-create of the mainframe so far to restore the mainframes status quo. Shall I in this same place do the modeless create for the CDialogs? I feel intuitively (thats a laugh - I am not old enough in this stuff for gut feelings!!!!) that this isnt t he place. SO maybe I should in the OnInitialUpdate of the view do something like:
If the registry says there are nonzero number of CDialogs information saved, then do
i =0; i < nCDialogs; i++
restore( what instead of the this that you have in your docs?)
You do a restore (this) but what should I restore? What should I have saved in my mainframe OnDestroy trhat I can use here?
DO you agree that I need to restore in OnINitiaUpdate?
Appreciate your help,
ns
|
|
|
|
|
I have a 4 character array which contains a hex number (ie. 02D1). I want to output the characters matching \x02 and \xD1 to my file. It works fine if I hard code it as "\x02\xD1", but the problem is the values are variable.
Anybody know of a function similar to CHR() that would handle this for me?
BW
"Gandalf. Yes. That is what they used to call me. Gandalf the Grey. *I* am Gandalf the White."
- Gandalf the White
|
|
|
|
|
Can't you use CString.Format, or an ostringstream to build the string with the \x values in it ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I tried using format(), but \x requires a number after it.
Anyway I ended out with the following:
<br />
CString sHeader;
int nHigh; <br />
char sHigh; <br />
nHigh = strtol(sHeader.Left(2),NULL,16);<br />
sHigh = nHigh;
Seems to work fine so far.. Thanks for your help.
BW
"Gandalf. Yes. That is what they used to call me. Gandalf the Grey. *I* am Gandalf the White."
- Gandalf the White
|
|
|
|
|
Hi.
I am working on a project that includes downloading data from webservers. There is a problem. Some webservers rejects the program request for data. In one example, the webserver responded with an error that the request was ignored because the client (program) is trying to access the data from another server. In terms of web browsers, this is like clicking on a link at www.google.com to download data from www.gamespot.com.
To my understanding, the server is incorrect because the program is communicating directly to the server just as a web browser does. I would like to know how do web server such as the example know where the client originally found the link to the data?
In the example above, is there any HTTP 1.1 code that I need to add to the request so that the server to process the request?
Thanks,
Kuphryn
|
|
|
|
|
This is from RFC 2616 which is HTTP 1.1.
Take a look at section 14.23 and 14.36. I think 14.36 is the key here. If I remember correctly, many servers use the "referer" field to know if content such as jpgs are being requested from pages hosted locally or from general requests from other websites. Lots of photo posting services do stuff like this so you can't store 1000 images on their site and then reference them from EZBoard.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
Okay. I have tried both solutions, but none worked. Here is an example of the request.
-----
/GET http://visualparadox.com/images/no-linking-allowed/coloroncall800.jpg HTTP/1.1
Host: visualparadox.com
Referer: http://visualparadox.com/wallpapers/coloroncall.htm
Accept: text/plain, text/html
Accept-Language: en-us
Accept-Encoding: gzip
Connection: Keep-Alive
-----
Again, the request above does not work. Here is one website I tested use to test the request.
http://visualparadox.com/wallpapers/coloroncall.htm
http://visualparadox.com/images/no-linking-allowed/coloroncall800.jpg
Kuphryn
|
|
|
|
|
I am using the Create() function to create a bunch of CEdit s in a CFormView derived class.
my problem is that as i tab through the fields they are not selecting the text in the field. they normally automatically highlight the text when the field gains focus.. it was the other day, but now its not.. any ideas?
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
dazinith wrote:
it was the other day, but now its not
What was different the other day? Has someone else added an OnSetFocus handler? It may help to compare your source file with a version from when it did work. Hopefully you can do that and see what changed.
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|