|
there is no souce code is available
to debug
if i put the code in my app the function is not calling only
and
SetBkImage() is not a member of CTreeCtrl
to over ride
its mentioned that it is overridable function
|
|
|
|
|
hi
I implimented CustomDraw
when i put lptvcd->clrTextBk = CLR_NONE ;
lables are painted with black color background but not trasparent
please some one tell me what shud i change in the code to get the CtreeCtrl lables trasparent
void CLeftPaneTreeCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
switch(pNMHDR->code)
{
case NM_CUSTOMDRAW:
{
LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW )pNMHDR;
lptvcd->clrTextBk = CLR_NONE ;
lptvcd->clrText = (RGB(0,0,255));
//SetTextColor(RGB(255, 0, 0));
//SetBkMode(lplvcd->nmcd.hdc,TRANSPARENT);
switch (lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
// Need to process this case and set pResult to
// CDRF_NOTIFYITEMDRAW, otherwise parent will never receive
//CDDS_ITEMPREPAINT notification. (GGH)
*pResult = CDRF_NOTIFYITEMDRAW;
return;
}
}
}
}
|
|
|
|
|
in my Tree control OnCustomDraw i have written code like this
void CLeftPaneTreeCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
switch(pNMHDR->code)
{
case NM_CUSTOMDRAW:
{
LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW )pNMHDR;
//lptvcd->clrTextBk = CLR_NONE ;
//lptvcd->clrText = (RGB(0,0,255));
SetTextColor(RGB(255, 0, 0));
SetBkMode(lplvcd->nmcd.hdc,TRANSPARENT);
switch (lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
// Need to process this case and set pResult to
// CDRF_NOTIFYITEMDRAW, otherwise parent will never receive
//CDDS_ITEMPREPAINT notification. (GGH)
*pResult = CDRF_NOTIFYITEMDRAW;
return;
}
}
}
}
in that code
SetTextColor(RGB(255, 0, 0)); works fine
SetBkMode(lplvcd->nmcd.hdc,TRANSPARENT); doesnt work ( it doesnt make TreeCtrl lables trasparent
CLeftPaneTreeCtrl is Derived class of CTreeCtrl
My I am hosting TreeCtrl on CView derived class MyView
and
if i uncomment both the lined comented in the code
lptvcd->clrTextBk = CLR_NONE ; -> doent work it paints Black background instead of transparent color
but any other color for eg lptvcd->clrTextBk = RGB(0,0,225) works fine
lptvcd->clrText = (RGB(0,0,255)); -> works fine
now I am not able to make lables trasparent
but one more thing ... the same method works fine in my CListCtrl with respect to trasparent lables ... ofcouse there r some other probs butfirst i wnana sort out the rpob with tree control transparent labels first
am looking for solution please help me out
|
|
|
|
|
help plzzzzzzzzzzzzz
modified on Friday, February 8, 2008 6:19 AM
|
|
|
|
|
Hi,
I am creating a dialog based application in MFC, and I am having a weird problem with one of the CWnd derived objects on my dialog.
Basically when starting the application, if it starts up such that the mouse pointer is over one particular dialog (which I created...) the hourglass doesn't go away until I move the mouse off that part of the dialog. As soon as I move it off the dialog it goes away. If it starts up such that the mouse over another part of the dialog it goes away just fine.
However, it's kind of annoying (and unprofessional) because that part of the dialog that causes the mouse the hourglass to hang is quite large.
Strange! Is there any way to programatically tell the hour glass to go away?
Thanks - @LRG
|
|
|
|
|
Ok,
Let me answer my own question - I just found that if I put EndWaitCursor() in the OnInitDialog memeber after creating the problem CWnd it works.
Wondering, is this a bit of a kluge?
Thanks - @LRG
|
|
|
|
|
@largeinsd wrote: Wondering, is this a bit of a kluge?
Sounds like it.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
@largeinsd wrote: ...the mouse pointer is over one particular dialog (which I created...)
How many dialogs are we talking about here? The first sentence in this post implies one dialog with several controls on it. Is there more to it than that?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: How many dialogs are we talking about here? The first sentence in this post implies one dialog with several controls on it. Is there more to it than that?
Yes, you're right - one dialog with several controls. One particular control is causing the problem.
@LRG
|
|
|
|
|
@largeinsd wrote: One particular control is causing the problem.
And what type of control would that be?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Wow you ask the tough questions... It's a custom (CWnd derived) class I found on this web site for doing OpenGL in an MFC Window. It's called a COpenGLControl.
Not trying to get folks to debug some random code I found on the interwebs, so that's why I was speaking in generalities.
Thanks - @LRG
|
|
|
|
|
Do you have an entry in your dialog's DoDataExchange() method for the COpenGLControl control? If so, can you temporarily comment it out and note the result.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Uh, hrrmmm, no I don't have an entry in DDX for that. I guess I thought I didn't need one, because it's a graphics control (running an openGL instance) not a regular control exchanging values from input. The only input it takes is mouse clicks to orient the view.
I guess I'll put one in (for DDX_CUSTOM(), eh?) and see what happens.
Thanks - @LRG
|
|
|
|
|
I have made Win32 project under Visual studio 2005. In this project I also included another project whose library needs to be used by my project. But the problem is that included project is written in core C and i am obviously having class based structure. So it is not allowing me to use library function of included project in my project. So how could i integrate these two projects? What configuration changes should i make under 2005?
Any help is much appreciated.
Thanks & Ragards,
Hemang
|
|
|
|
|
C++ projects can invoke C export functions, whereas C projects can not use C++ export functions and classes.
Maxwell Chen
|
|
|
|
|
Thanks for replying. I know this fact. But my problem is of some different sort. Let me more precise on the matter.
I am X.264 library for my project. This library has been generated using Msys and MinGW. I have included libx264.a in Additinal Dependencies tab. If i compile the included X.264 using C compile code in Linker/C-C++/Advanced/Compile As in project property page, then it is being compiled successfully, But if i compile as C++ then it gives me error. So what should i do? may i need to do any configuration changes for that under VS 2005?
Thanks & Regards,
Hemang
|
|
|
|
|
What are the error messages?
Maxwell Chen
|
|
|
|
|
error LNK2019: unresolved external symbol "struct x264_t * __cdecl x264_encoder_open(struct x264_param_t *)
|
|
|
|
|
Hemang Raval wrote: error LNK2019: unresolved external symbol "struct x264_t * __cdecl x264_encoder_open(struct x264_param_t *)
Because I don't have your source to view the whole relationship, I could only guess.
Check the includes and / or prototypes for:
extern "C" {
#include "some_header"
};
extern "C" {
x264_t* x264_encoder_open(x264_param_t*);
}
Maxwell Chen
|
|
|
|
|
Ok thats same as my problem.
Now i am posting my code
I am having two projects in one solution: one is Test1 and another one is Test2
Test1 having two files Test1.h and Test1.c
Test1.h
void testFunc();
Test1.c
<br />
#include "Test1.h"<br />
void testFunc()<br />
{<br />
printf("In Function testFunc()");<br />
}<br />
Now Test2 Having Two Files Test2.h and Test2.cpp
Test2.h
<br />
class Test2<br />
{<br />
Test2();<br />
}<br />
Test2.cpp
<br />
#include "Test2.h"<br />
#include "Test1.h"<br />
<br />
Test2::Test2()<br />
{<br />
testFunc();<br />
}<br />
Now i am compiling Test1 by c Compiler and Test2 by c++ compiler in "VS2005"
so it is giving me linking error as below:
error LNK2019: unresolved external symbol _testFunc referenced in function "public: __thiscall Test2::Test2(void)" (??0Test2@@QAE@XZ)
So do you have any idea regarding this??
Please Give me any idea, i am stuck on it.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
I just created two project:
1. C:\Tmp\Test1, in C,
2. C:\Tmp\Test2, in C++.
Test2 uses Test1 functions.
Steps:
1. Compile Test1 without worrying about Test2 at all.
2. Write this way in "Test2.cpp" :
#include "test2.h"
extern "C" {
#include "../test1/test1.h"
}
3. Remember to add (to import, not file copy) "C:\Tmp\Test1\test1.c" and "C:\Tmp\Test1\test1.h" into your "test2" project.
And everything compiles happily!
Maxwell Chen
|
|
|
|
|
Thanks
Its working fine.!!!!
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
Maxwell Chen
|
|
|
|
|
Hello everyone,
On Windows Server 2003, task manager there is a term called PF (Page File) and it has a related curve. Task manager also has another term called commit charge.
1. I think PF is the same as commit charge. Previously, I think Page File only includes the paged-out pages which physical memory can not contain, and the pages are not in memory are counted as PF. Now I think I am wrong and PF includes all committed pages, including the ones in memory and the ones on disk;
2. Even if the pages are marked as COMMIT, it is not always counted as a part of PF in some situations before it is actually used (request for zero and copy-on-write scenarios);
Are my understandings of (1) and (2) correct?
thanks in advance,
George
|
|
|
|
|
Hello everyone,
It is correct to assume that all exceptions from STL are either std::exception itself or derived class from std::exception?
thanks in advance,
George
|
|
|
|