|
I have a CDialog that displays a CTreeCtrl with checkboxes. How do i handle changing the check state?
I tried TVN_SELCHANGED and NM_CLICK but it seems that i'm too dumb to figure out how to get what i need
Thanks
|
|
|
|
|
|
Hi All,
I was looking at CMenuXP, which draw the entire menu. but the problem was it doesn't draw the arrow of the popup subitems. it lets windows to draw it by itself.
is there a way to bypass it? i need to draw the arrow with my own color (for enable and disable states)
thanks in advanced
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
I usually mixed them and come into a mess.
|
|
|
|
|
geez.
HWND : handle to a HWD, or to a Window.
HDC : handle to a DC, or to a Device Context.
|
|
|
|
|
yes, I can understand the window, but what is exactly the Device Context? what's this include? Dose it include the window, the button, the listbox....etc?
|
|
|
|
|
A data structure in Windows programming that is used to define the attributes of text and images that are output to the screen or printer. The device context (DC) is maintained by GDI. A DC, which is a handle to the structure, is obtained before output is written and released after the elements have been written.
RinuRaj
|
|
|
|
|
bloodwinner wrote: ...what is exactly the Device Context?
See here.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It pointed at the first line -#include "stdafx.h" and report this error. How to solve this problem?
|
|
|
|
|
|
when using precompiled header (see in your project setting), the #include "stdafx.h" directive must be leading every other includes in a cpp file.
ps: delete your other duplicate post
|
|
|
|
|
Rebuild all to recreate the PCH file.
|
|
|
|
|
It points at the first line "#include "stdafx.h"" and gave this fatal error.
|
|
|
|
|
Just take a look in MSDN[^]
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
I tried running the sample provided with MSDN. It also fails with the same error code. Does anybody know why is the function call failing in my computer?
|
|
|
|
|
Hi guys,
I tried making my own timer application, where a number increments every second.
I just wonder how SetTimer() and OnTimer() works? My timer class really does not work! It can initialize the timer but then it does not get into the OnTimer() function even when the time is due. How does this really work? I would really appreciate it if someone can give me a simple but concrete example. Yes, there are some samples in the internet, but really, I could not understand the mechanics beneath them. Can someone provide me with simple steps on creating this simple timer class?
If I could only make this work.. my timer class is super essential to make everything in my application work.
To the person who could help me with this, kudos to you!
Many thanks,
Christina
|
|
|
|
|
waxie wrote: It can initialize the timer but then it does not get into the OnTimer() function even when the time is due.
Can you show how you have initialized it?
Simple example would be like this
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_CREATE()
ON_WM_TIMER()
END_MESSAGE_MAP()
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
SetTimer(1,1000,NULL);
return 0;
}
void CMainFrame::OnTimer(UINT nIDEvent)
{
CFrameWnd::OnTimer(nIDEvent);
}
|
|
|
|
|
For your using OnTimer() you need to inherit your class from CWnd base class.
// Header file should look like this
class CMyTimer: public CWnd
{
...
afx_msg void OnTimer(UINT nIDEvent);
DECLARE_MESSAGE_MAP()
};
// Source file should look like this
....
BEGIN_MESSAGE_MAP(CMyTimer, CWnd)
ON_WM_TIMER()
END_MESSAGE_MAP()
void CMyTimer::OnTimer(UINT nIDEvent)
{
//Todo
}
Do not forget to create a timer object after construction the object
i.e., any where in the program you should -
CMyTimer *pTimer = new CTimer;
pTimer->Create(......);
pTimer->SetTimer(.....);
Your Timer should then work.
|
|
|
|
|
Why would you create a whole class just for a timer? Seems to be overkill.
|
|
|
|
|
|
|
|
hIcon = (HICON)LoadImage(...)
should work
|
|
|
|
|
Try (HICON)LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
Thanks
|
|
|
|
|
try
<code>
(HICON)LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
</code>
Thanks
|
|
|
|