|
You can override PreTranslateMessage
Read this article :-
http://www.codeproject.com/useritems/pretransdialog01.asp
Nish
One Nish is trouble enough.
Imagine 16 of me, dancing wild...
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
:jig::jig::jig::jig:
|
|
|
|
|
That Button is your default control in your dialog,if change this property in dialog editor I THINK this problem will solve.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
No, I think you still need to overwrite PreTranslateMessage (or a different approach as pointed on a previous message).
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Yes,I test it and you are right.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi,
I have a dialog box with 3 edit boxes, IDC_EDIT1,2 and 3 with variables m_edit1,2 and 3. There is also 3 radio buttons in a group called IDC_numbers with m_numbers as its variable. There is also a button called generate which is IDC_GENERATE with the variable OnGenerate to deal with the message handler for when the button is clicked. what I want to do is when the first radio button is pushed (i.e m_numbers=0) and the button Generate is pressed then 3 numbers appear on the edit boxes. when radio button2 is pressed (i.e m_numbers=1) and button generate is pressed then 3 different numbers appear on the edit boxes. I know how to get the box to display the numbers on the edit boxes when the button generate is pressed but how do i impelement the condition to display the numbers according to what radio button is selected?
Thanks a lot for any help
|
|
|
|
|
On the button pressed handler, call UpdateData(TRUE) to retrieve the radio selected, the value will be stored on your variable: m_numbers.
the, do a switch with this variable:
switch( m_numbers )
{
case 1:
//put some logic to generate the three numbers
break;
case 2:
//put some logic to generate the three numbers
break;
case 3:
//put some logic to generate the three numbers
break;
}
(Haven't tested)
I'm not sure if the value of m_numbers is zero-based, I think it is.
This is not a Design advice, just a way to make it work.
I would code a GenerateNumbers(int iSelectedOption), then in Button Pressed Handler obtain the radio value selected and pass it to GenerateNumbers, inside that method code the Switch statement, a little more cleaner.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
|
I think I already know the answer to this one but if someone could point me a link of a document stating the answer, let me know.
Question is:
If I link my program using MFC as a Static Library instead of Shared DLL, does it uses more memory/resources of the computer ? Even if its the only MFC app I´m running in this computer ?
Let see if your opinions match with mine.
Mauricio Ritter - Brazil
Sonorking now: 100.13560 Trank
My latest article:
Pentominos - A C# implementation of the famous Puzzle Game
|
|
|
|
|
Unless the changed the memory manager (which I remember reading hints about this in some places), statically linked takes up more resources since the code pages in the DLL can't be shared between processes. Now if they changed it so that code pages (or any read-only page) aren't shared, then there really wouldn't be any difference other than extra disk usage.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Ok, I looked into this a little more. Here is something interesting I found on google groups.
Dll's are "loaded" using the win32 memory mapping mechanism, and the pages are marked copy-on-write (that is, a code page that gets written to get copied, and mapped against the pagefile). The result of this is any pages that are the targets of relocation fixups are not-shared (the relocation fixup code *writes* the fixups back into the code).
However, switching to a non-ms compiler - if you compiled the Dlls object code as position independent code then there will be no relocation fixups associated with any of the code pages. The win32 dll loader will simply map all the pages into memory without any fixups "touching" the pages the result is that the dll will load at any address without any problems.
What this implies is that when using a DLL, code pages will be shared. HOWEVER, if a code page requires a fix-up as part of image loading, then a copy of that page is made and the pagefile is used for backing store. Normally, with read only pages, the disk image of the DLL is used as backing store. Thus if the page is faulted out of memory it will just read it back from the DLL when it is needed again. In the case of a page that required fix-ups, it will end up on the modified page list and ultimately written to the page file if that physical page of memory is required for other needs. Then when that page of code is required by the program in question, it is read back from the page file.
Hopefully I got all this right. Some of this is based on my understanding of the VMS paging system which was a predecessor to the NT paging system. Aren't paging systems fun
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Since when did windows programmers care about eating up resources anyway???
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
I have tried my CAsyncSocket app over the internet but it doesn't work.
It should work... or am I wrong?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Yes, it should, just make sure you are connecting to a valid IP Address.
If you're using a name (instead of a IP Address) make sure the computer can resolve that name to an IP (try ping <>)
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Is there a specific Internet IP then?
I use my "computer" IP,, (don't know what to call it)
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
No, i mean.. if you're are connecting to a distant machine on the internet, then make sure you can 'see' that machine, try ping <<machinename>> or ping <<ipaddress>>
You said that were using the class over internet, so I assume you're trying to connect to a far away machine through internet.
makes sense?
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
I want to append or add an item to the pop-up menus (appear when right-click), like Winzip do to Windows Explorer when instaled...
It will be usefull to my application, a "Dialer", because, when the user select a number in another application (Windows Explorer, Internet Explorer, Word, Outlook, etc.), sometimes he want to right-click over the selected number to dial to the selected number using the "dialer"...
I have no idea, how may I implement this?
Cesario
TIA
Cesario Simões
Florianopolis - SC - Brazil
|
|
|
|
|
Adding menu items to Explorer is done with shell extensions - see my articles on that topic in the Shell section here at CP.
Adding to other programs' menus is a whole different matter. The Office apps let you write extensions as well, however I have no experience doing so. Check your Office docs as I'm sure the process is explained there.
--Mike--
Rollin' in my 5.0
With the rag-top down so my hair can blow.
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
I want to append or add an item to the pop-up menus (appear when right-click), like Winzip do to Windows Explorer when instaled...
It will be usefull to my application, a "Dialer", because, when the user select a number in another application (Windows Explorer, Internet Explorer, Word, Outlook, etc.), sometimes he want to right-click over the selected number to dial to the selected number using the "dialer"...
I have no idea, how may I implement this?
TIA
Cesario
Cesario Simões
Florianopolis - SC - Brazil
|
|
|
|
|
How can I read an mp3 file to see how long the song is?
I guess that I have to do formula with something....
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Something about mp3 in this link but I don't know it has the thing you want too.
http://www.codeproject.com/audio/mp3player.asp
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
You may have to walk the frames. See this article for more info. Unfortunately, the book is out of print.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
IF you can rely on DirectShow, it will give you this info.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Hi,
I have a dialog box with three edit boxes, IDC_EDIT1, IDC_EDIT2 and IDC_EDIT3 with three member variables, m_edit1,2 and 3, which are all of type float There is also a button, IDC_CALCULATE, with a message handler onCalculate. When the button is pressed then 3 calculations occurs in the OnCalculate message handler and the values are displayed on the three edit boxes.. what I want to know is what can I add to the OnCalculate handler to display the numbers on the edit boxes with 2 decimal places. For instance one of the calculation variables (edit1calc) is defined as type float and is worked out using (7/14 * 100). the answer is 50 but how can i get it to display 50.00 on the box rather than just 50?
Many thanks in advance!
|
|
|
|
|
You can't achieve this with DDX. You'll have to format strings manually (with CString::Format, for example) and display them in edit boxes with SetDlgItemText or SetWindowText.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Use the CString::Format function, with the correct Format Specification, that force to Display de Ceros....
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|