|
Well I worked around it so that I can use it the way I want!
Basically I added an invisible Month Calendar control which I then set to the same space as the DateTimePickers rect in the DropDown handler. I also set a flag for bMonthShowing.
In the OnPaint method I use the bMonthShowing flag to let me know to reposition the windows
m_pMonth->SetWindowPos(&wndNoTopMost, 0, 0, 1, 1, SWP_NOMOVE | SWP_SHOWWINDOW);
m_ctlMonth.SetWindowPos(&wndTopMost, 0, 0, 1, 1, SWP_NOMOVE | SWP_SHOWWINDOW);
In the CloseUp handler I set the MonthCalendar invisible.
For the month calendar I handle the GetDayStates to set which days I want bold.
In the OnSelect for the month calendar I do the following:
COleDateTime t;
SYSTEMTIME tt;
BOOL ret = m_ctlMonth.GetCurSel(&tt);
t.SetDate(tt.wYear, tt.wMonth, tt.wDay);
m_ctlDatePicker.SetTime(t);
(If I did the GetCurSel directly into a COleDateTime it comes back with an invalid status )
And everything works! <edit> All right I missed one or two (or more) things. oops
What a kludge!
If you want I can send you the whole dialog project. Let me know.
Dave
|
|
|
|
|
I just checked the result of pMonthCalCtrl->GetStyle() before and after the use of the ModifyStyle function and the result is the same. (The ModifyStyle seems to be affecting the wrong style?)
Thanks for all your help so far
|
|
|
|
|
I also tried ModifyStyleEx and that had no effect either.
|
|
|
|
|
I think this should work:
HWND hwndDP = pCalCtrl->GetSafeHwnd();
ASSERT (hwndDP != NULL);
HWND hwndMC = DateTime_GetMonthCal (hwndDP);
ASSERT (hwndMC != NULL);
CWnd* pMCCtrl = CWnd::FromHandle (hwndMC);
ASSERT (pMCCtrl != NULL);
DWORD dwStyle = pMCCtrl->GetStyle();
dwStyle |= MCS_DAYSTATE;
pMCCtrl->SetStyle (dwStyle);
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
The intent was to show every step in detail.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
pMCCtrl->SetStyle (dwStyle);
No such function as CWnd::SetStyle()
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Gak! What was I thinking!? Thank you!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
There is cool code here:
http://www.codeproject.com/dialog/bmpdlg01.asp
that shows how to make a bitmap a background for a
CDialog. I have a rather large bitmap, its about 1600x
600 pixels and when I use that bitmap, it looks great
but if I scroll up or down, the images flickers or doubles
up or drags with the scrolling and looks really bad.
Any chance any one has experienced this and has a
resolution? I tried just laying the bitmap in a CDialog
and laying edit boxes on top of the bitmap. But the
edit boxes disappear under the bitmap and Im just perplexed.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Just poking around here, this probably won't work... but if your image covers the entire dialog surface try NOT calling the base class CDialog::OnEraseBackground() .
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
hi all
i am just starting to try and learn c++. i am finding this site very helpfull. does any1 else out there have ny other tips,web sites or just genral help for me? i would be really greatfull if you do!
thanks a lot
Matthew Burns
P.S you can also email me should you want to for any reason on amattburns178@hotmail.com
matty b
|
|
|
|
|
hey, the forum is for asking specific programming questions... we cannot guess what you need and what you don't.
ask for something, you'll get an answer (we'll try to...)
for C++, you can have a look at The C++ Language (but it's a book, not a site) from Bjarne Stroustrup, even if it is not for beginners (say Maxwell chen... hello maxwell )
TOXCCT >>> GEII power
|
|
|
|
|
Man whatever you need to ask my mail address is eu_acela@yahoo.com
eu_acela@hotmail.com
gabby
|
|
|
|
|
I come back from a 2 week break and notice that my code no longer works - I am getting errors related to
i386\chkesp.c<br />
The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.<br />
As I believe nothing has changed with the file(s) going into this build, maybe some compiler settings were changed. I'm at a total loss and need some advice/direction.
Thank you.
Johnny P
|
|
|
|
|
Did you do a clean and Rebuild All?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I have my files in VSS - since coming back from hiatus, I did a "Get Latest" into clean folders, rebuilt everything and then ran.
My situation can be generalized as follows:
<br />
1) a dialog class that contains some processing (OnOk, etc.)<br />
CAdjustTimesDlg<br />
<br />
2) CAdjustTimesDlg has a private function (the offender)<br />
void UpdateTheList(CMyData item1, CMyData item2);<br />
<br />
3) AdjustTimes.cpp has the caller as:<br />
UpdateTheList(item1, item2);<br />
<br />
void CAdjustTimesDlg::UpdateTheList(CMyData item1, CMyData item2)<br />
{
}<br />
I have tried looking at the .DSP (settings), but there was no change. I tried explicitly casting the call as:
<br />
(void) UpdateTheList ( (CMyData) item1, (CMyData) item2 );<br />
But nothing I've tried so far has worked. It confuses me because there was no problem in previous builds and executions - I don't see anything that has changed.
Thanks.
Johnny P
|
|
|
|
|
Hi,
I need a help in converting files like .doc, .xls etc to tiff files.
I think that the ideal is a driver lika a printer driver.
Thanks in advance
|
|
|
|
|
I looked through Word's Save As list and did not see TIFF as an option. That's not to say it cannot be done, but having not ever done this, my initial response is "Is it possible, since Word does not offer such a conversion?"
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have a char buffer[20000] defined. I need to extract words from the buffer which has a string of characters which varies in length. I am not able to use substring to extract the word from the start position. how do extract a string from within a string in VC++.
|
|
|
|
|
_strtok() comes to mind. Or how about strcspn() ? If I'm way off, then I do not understand your question.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
strtok tokenizes the string, and strcspn gives the starting position of the string i am searching. I want to extract the string given the starting position and number of characters to extract. say for example i have "This is a test sample", using substring i should be able to extract sample.
substring in itself doesn't work in VC++. i don't know what equivalent is in VC++.
|
|
|
|
|
How about:
char *str = "This is a test sample";
char sub[7] = {0};
strncpy(sub, &str[15], 6); or
memcpy(sub, &str[15], 6);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
mid()
TOXCCT >>> GEII power
|
|
|
|
|
Hi
I'm designing a multiclient drawing board. There's a pencil. When you click (OnLButtonDown) on the pencil over an area, CPoints are added to a CPoint list(OnMouseMove), and when you release the mouse button (OnLButtonUp), a (-1,-1) is sent to the list.
I sent that, so that in the OnPaint function, LineTo's are called for every point of the list, and when you get a (-1,-1) it means that the line ends.
When you release the mouse button(OnLButtonUp), the list is sent to the other drawing board.
The problem is that while you are drawing (without release the mouse button), and the other person draws something, when he realeases the mouse button, the list is sent to the other person, and i don't want that to happen.
So i thought of CCritical Section. The drawing board, has the list of CPoints, and i wanted the board not to receive while you are drawing.
So i declared in the drawing board class:
CCriticalSection CritSect;
And in the OnLButtonDown, i call CritSect.Lock(), and in OnLButtonUp, i call CritSect.UnLock(), hoping that when you are drawing, a list wouldn't be inserted to your list when you are drawing. but that doesn't happen.
Do you have any ideas of what i'm doing wrong? perhaps the CCriticalSection approach is wrong.
thank you very much for your help!.
|
|
|
|
|
Depends on who your clients are and how they are calling into your program.
Do you have multiple threads running?
If no, then you need something more like a code for ownership, that is not a 'thread' protector. You can somehow identify your clients by a code, and then only allow the button down to assign a client to the list if no other client is using the list. And only respond to the button up if the client already owns the list.
|
|
|
|