|
Hi Ravi,
Or in ~CFooView() or CFooView::PostNCDestroy() or ...
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hi Neville,
Actually the tack I took only handled the case when the user closed the view manually by clicking the "x" button. It didn't handle the ID_FILE_CLOSE case, so I used a custom command and handled document closure myself.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
how can i add a menu in a dialog based application??
|
|
|
|
|
Create a menu in the resource editor, then modify the dialog's "Menu" property (also in the resource editor) to point to that menu.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
the first,you create a new menu whit ID_DLG_MENU
the second,see the dialog property.
select the ID_DLG_MENU int the Menu:
|
|
|
|
|
I have a dialog template. I create a CPropertyPage class on it, and add it to my property sheet.
On this dialog, I have a combo box as a drop list. My question is: the combo box content is added at run-time. Its string format is as follows:
%2d: %-35s %02d
The problem is: using the default font, the string part will have variable length. I tried to overwrite the OnSetFont() as:
if ( HFONT(myFont) )
{
pFont->DeleteObject();
pFont = &myFont;
}
CPropertyPage::OnSetFont(pFont);
I have tried to use different font, "Arial", "Courier", "System", "Times New Roman", but all of them gave me a big bold ugly font displayed on the dialog.
what's the correct way to do it?
Thank you a lot!
|
|
|
|
|
I'm not sure I understand what the problem is...
Your string part will be variable width...? Whys that a bad thing...?
I suppose your gonna wanna use a fixed width font like Courier New (Courier should work also???)
What are you trying to acocmplish...? Just change the font..?
Do it inside InitDialog() with a call to the controls SetFont()
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi
I want to store IPs in a linked list using CList , but don't know how to do that. Servers already in the list should not be stored in the list again. Currently I can't compile my project due to errors.
This is what I want to do:
CList<sockaddr_in, sockaddr_in&> SockList
for(int i=0; i<num_servers; i++)
{
if(SockList.Find(server) == NULL)
SockList.AddTail(server);
}
server is of type sockaddr_in* .
How can I achieve this?
thanks in advance
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You cannot search a list of pointer using its default equality comparison.
I recommend an STL list or map and with a custom equality or equivalent search algorithm via a function object.
Kuphryn
|
|
|
|
|
Thanks
Is there no way to copy the values of a sock_addr* pointer into a normal sock_addr variable?
This way it would be possible, or am I wrong?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Consider memcpy(). I am not completely sure that will work for sock_addr.
Kuphryn
|
|
|
|
|
But if he do something like this then:
sockaddr_in addr = *addrpointer;
I don't know if this is allowed!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I want to add a spin control in a combo box. When dropped down, the combo box shows the items in the combo. But, the up/down arrow keys should not change the items in the combo automatically, but send the notification of the spin control to the parent window.
Now, whether I set the combo box or the edit control in the combo box as the spinner buddy, I do not get up/down notification when the arrow keys are pressed in the combo box. Is there any way to prevent the default arrow key handling of the combo box?
-Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I'm not sure I totally understand, but i'm thinking your gonna have to subclass the drop down list box and respond to WM_VSCROLL by forwarding it to the parent window and not letting default processing continue...
In my priority combobox control I subclass the listbox control, so you may wanna look at the code I borrowed from another author (whose name I can't remember). Anyways...it works and the code is straight forward...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
The idea is that, there is a combo box that displays numbers, say 10, 20, 30.
Now, I want a spin control that has an inc/dec value of 1. So, if I press up arrow and the selected value was 10, it should become 11, 12 and so on...
But, if I click on the combo box drop down it should show only 10, 20 and 30.
Now, trying to implement this, I added a spin button control and made the combo box its buddy. But, the up/down arrow moves only between 10, 20 and 30, but using the mouse on the spin control, I can go to 11, 12 etc.
So, what I want to do is to prevent the combo box from handling up/down arrows - and allow the spin button control to get them.
I will look into the code that you mentioned.
Note:- I was secretly hoping for some combo box style, that would prevent it from handling arrow keys . Not so lucky I guess.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Your gonna have to subclass...I see no other way of doing it...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
A lot of DirectMusic8 functions ask for MUSIC_TIME arguments. What is MUSIC_TIME? The SDK Help doesn't say. What format is MUSIC_TIME in (milliseconds, seconds, etc)? Do I have to set the format? If so, how?
Thanks in advance.
|
|
|
|
|
Music time is a 32-bit value defined as type MUSIC_TIME. It is not an absolute measure of time but is relative to the tempo. The clock is started when the performance is initialized and ticks DMUS_PPQ times for each quarter-note. DMUS_PPQ is defined as 768
|
|
|
|
|
Music time is a 32-bit value defined as type MUSIC_TIME. It is not an absolute measure of time but is relative to the tempo. The clock is started when the performance is initialized and ticks DMUS_PPQ times for each quarter-note. DMUS_PPQ is defined as 768
|
|
|
|
|
Hi,
I need an Edit Control, which allows to read very large files in smaller
portions(not the whole file at once), and read the appropriate portion of the file depending on the Arrow or Page Up-Page Down keystrokes or Scroll Bar position. Is anyone aware of a class like this on this website or other sites?
Thanks a lot,
Yehuda.
|
|
|
|
|
ummmmm
its really easy to do this urself
just have saya cstring that holds the reqd bit of text and keep track of where in the file u are ... when u need a new bit just read from the new offset and display it
"even if my world is weird it's my world" biz stuff about me
|
|
|
|
|
One solution is a vector of string object or CString object, each representing one line of text in the editbox. Use a list if you want to delete one or more line.
Kuphryn
|
|
|
|
|
I have a SDI application ,the main view is implement CFormview,but the controls reside in the form can not receive COPY or PASTE message,how to do it?
Thank a lot!
Please pardon my weak English!
|
|
|
|
|
What are COPY and PASTE messages?
You may want to copy and paste data according to a context menu or when the user presses a certain key.
Kuphryn
|
|
|
|
|
kuphryn wrote:
What are COPY and PASTE messages?
Perhaps he mean the WM_COPY and WM_PASTE messages?
They only works with an EDIT control!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|