|
hugo_fra_tv2 wrote: ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
This might be the problem normally we specify the filter as follows (seperated with "|" and ends with "||"
e.g
char* pszeFilter = "*.*|*.*|text|*.txt|Music|*.mp3||";
SaRath.
"Don't Do Different things... Do Things Differently..."
Understanding State Pattern in C++
|
|
|
|
|
The separator depends on approach used. If the filter is set in OPENFILENAME structure directly, then '\0' must be used. If the filter is set in the constructor of CFileDialog object, then '|' is used. CFileDialog will convert it to '\0' .
|
|
|
|
|
Is there a possibility to create a datetimepicker in a dialog without days (only with month and year)?
Thanks, Gerhard
|
|
|
|
|
Not without Owner/Custom draw.
You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!"
|
|
|
|
|
Sounds complicated, so I will look for another way to enter month and year.
Thank you for your fast answer, Gerhard
|
|
|
|
|
If you are interested try a custom control, using COleDateTime class.
- NS -
|
|
|
|
|
m_datetimepicker.SetFormat ("yy-MM");<br />
can help you. <br />
<br />
Somethings seem HARD to do, until we know how to do them.<br />
;-)<br />
_AnShUmAn_<br />
<br />
<br />
-- modified at 4:47 Friday 9th June, 2006
|
|
|
|
|
Hallo,
But some things are HARD, even you got an answer that seems to be the solution.
I made my dialog with the wizzard and got a diaolg.cpp with a DoDataExchange-function like this:
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_begin);
m_begin is a COleDateTime-variable. But where and how do I have to place your Set.Format-code? I tried it with IDC-DATETIMEPICKER1 in an OnInital-function , in a PRECREATE-function, I tried it with the m_begin-variable, nothing works.
Thanks in advance, Gerhard
|
|
|
|
|
m_begin should be a control variable for the date time picker control .
Right click on the datetime picker contrl > add variable m_begin
in on initdialog use
m_begin.SetFormat()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hallo,
That works wonderful in my dialog, but I have a last problem. How can I get the valus of year and month at the end of the dialog. What I did till now was:
year.Format("%i", dialog.m_begin.GetYear());
month.Format("%i", dialog.m_begin.GetMonth());
And that doesn't work any more year and month are CStrings, but would not be a probelm if it would be int ore something other.
It's like it is always - the solution of one problem results in another problem
Thanks - Gerhard
|
|
|
|
|
|
Hi ,
I tried the following code in right mouse button clicked function for the List ctrl...It gives the submenu of the 5th menu in the menu bar...but its not giving the submenu where i right clicked the mouse button in the list ctrl
...
UINT nFlags;
CPoint point;
CMenu* menu_bar = AfxGetMainWnd()->GetMenu();
CMenu* file_menu = menu_bar->GetSubMenu(5);
ASSERT(file_menu);
file_menu->TrackPopupMenu(TPM_LEFTALIGN |TPM_RIGHTBUTTON, point.x,point.y, this);
Can anyone help me in this problem....
with regards,
Raja Bose
|
|
|
|
|
Raja Bose C Leo wrote: CPoint point;
From where you got the values of point? They should be in screen coordinates.
- NS -
|
|
|
|
|
thans for replying...
hmmmm i got it .... thans i got it .... thans for pointing out my mistakes..
hmmm its working fine
with regards
Raja Bose
-- modified at 2:47 Friday 9th June, 2006
|
|
|
|
|
Use CPoint point(GetMessagePos());
- NS -
|
|
|
|
|
whats value for point try this
<br />
CPoint point;<br />
GetCursorPos(&point);<br />
whitesky
|
|
|
|
|
Wow great its working fine.....
thans for ur help whitSky
once again thank u very much...
With regards
Raja Bose
-- modified at 2:57 Friday 9th June, 2006
|
|
|
|
|
you're welcome but
Raja Bose C Leo wrote: whitney
whitesky
|
|
|
|
|
Don't you think that GetMessagePos is better?
- NS -
|
|
|
|
|
|
I mean GetCursorPos will return the current position of the cursor, while GetMessagePos will return cursor position for the last message retrieved by the GetMessage function. So for processing a mouse click, it is better to get the position of the cursor at the time of that message was processed, rather than getting the current position, right?
- NS -
|
|
|
|
|
--------------------------------------------------------------------------------
Hello everyone,
I am discussing with my friends about an interesting question about find the maximum element in a set, which is the sum of two other elements.
For example, in set {1, 2, 3, 5, 8, 10}, the answer is 10 (10 = 8 + 2),
which is the maximum element we can find, and it is the sum of two
other elements (8 and 2) in the set.
Currently, I only have brute-force solution. Sorting the set, which takes O(nlgn) time, then enumerate them one by one to find whether two elements can sum up to the maximum element (if the most maximum element does not meet the condition, move to the second largest one), which takes O(n^2) time, so the total time complexity is O(n^2).
I am wondering whether any one have better ideas?
thanks in advance,
George
|
|
|
|
|
Hi to all,
In my project, I am using Combo-Box with following properties in ‘style’ tab,
Type : Drop List
Owner Draw : No
Sort : check mark
Vertical Scroll : check mark
Auto HSCroll : check mark
But when I run the code, for nay long string in the combo-box I can’t scroll horizontally.
Plz, help me to set the combo-box to view string in it’s list Horizontally also.
Thanks in advance,
Best Regards,
Aniket
|
|
|
|
|
|
I think, the horizontal scrolling is available only when type is "Dropdown" (i.e. the combo-box is editable) and Auto is true.
If no other solutions, you can switch to "Dropdown" type and try to obtain the handle of the combo-box’s child editor (using GetComboBoxInfo member in Window XP) and make it read-only.
|
|
|
|