|
ON_UPDATE_CMD_UI handler is called whenever user opens the menu. You have to check the state of the program and pass correct value to CCmdUI::SetCheck.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have an application, with several functions, and one of these have to return a pointer on COleDateTime. I know the size of the "array" of COleDateTime dates, 2, but i meet a problem when i start debugging when i look in the debug window.
When i declare in the function a COleDateTime pointer i could use 2 way to do that.
Firstly, i just could write:
COleDateTime pDates[2]; and in the debug window i could see:
pDates
[0]->m_dt
->m_status
[1]->m_dt
->m_status
and in another way i could do it:
COleDateTime *pDates=new COleDateTime[2];
and in debug window i only see that:
pDates
->m_dt
->m_status
So, what is the good way if i want to return 2 dates different?
Thanks in advance
gerald
|
|
|
|
|
You should be able to see the two dates in the debug window by modifing the debug view to look at,
pDates[0] and pDates[1].
There is no real difference between COleDateTime Dates[2] and COleDateTime* pDates = new COleDateTime[2] (apart from where the allocate memory goes)
Michael
|
|
|
|
|
Hello all,
as I mentioned I would like to display one (specified by me) member value of some class. You can observe this for MFC objects - e.g. CWnd displays value of m_hWnd in curly brackets.
I looked into definitions of some MFC classes (CWnd and CString) and didn't see anything 'magic'.
Does anybody know something about it?
Regards
Bartek
|
|
|
|
|
You mean in the debugger ? Just type it into the debug variable window.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hmmm, I wrote bad topic
It's not so trivial ... I want to display value of specifed member while in 'Variable' window an object of the class containing this member is listed.
For example:
+this 0x00432990 {CManagersView hWnd=0x004604e6}
Class CManagersView is derrived from CView and automatically displays it's 'primary' member - m_hWnd.
Regards
Bartek
|
|
|
|
|
autoexp.dat located in <vstudio>\common\msdev98\bin contains the 'magic'.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
That's it!
Thanks a lot
Regards
Bartek
|
|
|
|
|
I am creating buttons dynamically in my dialog box by creating them as windows using CreateWindow and putting bitmaps on top of the buttons. This works fine, however, I want to change the background colour of these buttons to a lighter colour. I'm guessing that I use SendMessage but as to which message and parameters I'm lost. Could anybody point me in the right direction. I've checked some articles but they are geared more to using the resource editor or owner-drawn buttons.
Thanks in advance for any help,
Nick
|
|
|
|
|
Sorry - you can't change the background of the button with one simple SendMessage. And processing WM_CTLCOLORBTN won't help either; here's what MSDN says:
Buttons with the BS_PUSHBUTTON, BS_DEFPUSHBUTTON, or BS_PUSHLIKE styles do not use the returned brush. Buttons with these styles are always drawn with the default system colors. Drawing push buttons requires several different brushes-face, highlight and shadow-but the WM_CTLCOLORBTN message allows only one brush to be returned. To provide a custom appearance for push buttons, use an owner-drawn button.
So, if you need custom background, you have to use owner-draw.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Ok, thanks, I suppose I can get around it by altering the bitmap itself to have a white border or something, I'll work on that. The reason I wanted to do it was because some of the bitmaps I was drawing had a grey edge on some sides which was the same colour as the button itself so the border wasn't showing.
Thanks anyway,
Nick
|
|
|
|
|
Hi
can you advise for me library with tree template class, like STL list or vector
Ernst
Thanx
|
|
|
|
|
map is a balanced, sorted binary tree.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hi everyone!
I am writitng a MDI application with CRichEditDoc and CRichEditView classes.
Now I want to add some spliter windows so I added like this:
Project>add to project>components and
controls>visual c++ components>splitter bar"
when i run the application the splitter is created, but my childframes
windows look very
funny. I have 2 vertical scroll bars and 2 horizontal scroll bars, one is
the default that comes with CRichEditView, and the second is the one created
by the splitter. If I drag the splitter bars somewhere in the middle and
then begin typing something
in one pane I cannot synchronize the text in all the panes. Also the scroll
bars seem not to be working properly.
I have posted this topic on several forums, but nobody seems to know the answer!
Please give me some help
Alex
|
|
|
|
|
Hello,
I think that all is asked in the subject... Indeed I'm working under Windows CE 3.0 more accurately. All Microsoft apps do this to display the standard Copy/Cut/Paste menu, but I really don't understand how it's done.
By the way if anyone knows where to find such sources (from Microsoft standard apps packages provided on PocketPC, or from anyone else°, I would really appreciate.
Thank you.
Please, also send your answers to my email address: francois_pessaux@yahoo.fr
--Francois
|
|
|
|
|
|
1. How knowing full path to a file and current directories to receive relative path to a file?
2. And on the contrary, knowing a relative path and current directories to determine a full path to a file?
|
|
|
|
|
Look at this 2 functions
char *_fullpath( char *absPath, const char *relPath, size_t maxLength );
void _splitpath( const char *path, char *drive, char *dir, char *fname, char *ext );
|
|
|
|
|
Hi,
How can I get Start menu and pop it up anywhere on screen like user have clicked on Start button ?
thans a lot,
|
|
|
|
|
hi,
I am using a property page to get Tabs in my project in one of the tab. I Need to have a splitter window
can any one help me in doing this.
|
|
|
|
|
hi,
I am using a property page to get Tabs in my project in one of the tab. I Need to have a splitter window
can any one help me in doing this.
|
|
|
|
|
Hi,all
I got an error when I run one window about 80 times.The error is like the following:
Second Chance Assertion Failed: File afxwin1.inl, Line 283
source code in "afxwin1.inl" is the following,
282: _AFXWIN_INLINE int CGdiObject::GetObject(int nCount, LPVOID lpObject) const
283: { ASSERT(m_hObject != NULL); return ::GetObject(m_hObject, nCount, lpObject); }
m_hObject is a NULL pointer when I load a bitmap(bitmap.LoadBitmap(..)). these code runed for about 80 times recycled, then I get a NULL pointer m_hObject. but I don't know why m_hObject is not a NULL pointer when these code run for the first 80 times.
I think it is a memory leak error,but after every CBitmap object was used, DeleteObject() was followed. Could anyone give me some advice about how could result in this error, and how can I fix it.
Thanks.
|
|
|
|
|
This '80 times recycled' points to a GDI resource leak. Probably you have your bitmap selected into some device context when you 'recycle'. In such case, old bitmap isn't deleted.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I called the API ::playenhmetafile to play a metafile under win98. If I play three hundred files once time, it will cause bad gdi leak and gdi resource fall down to zero. But it works well under win2000. why?
thanks to all the programmers who have helped me.
|
|
|
|
|
Because Windows 2000 detects memory leaks and cleans up after you. Ar you *sure* you aren't leaking memory ? I'd suggest posting your code, I'd be happy to provide a sanity check.
Are you calling ::DeleteEnhMetaFile(); ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|