|
I am not as familiar with mfc.
Can you help me about draw each column by programmer.
Or you can give me any related project in which CDRF_SKIPDEFAULT return value is handle.
punita
|
|
|
|
|
try the code below
void ListCtrlEx::OnCustomDraw( NMHDR* pNMHDR_i, LRESULT* pResult_i )<br />
{<br />
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR_i );<br />
NMCUSTOMDRAW &nmcd = pLVCD->nmcd;<br />
*pResult_i = CDRF_DODEFAULT;<br />
switch (nmcd.dwDrawStage)<br />
{<br />
case CDDS_PREPAINT:<br />
*pResult_i = CDRF_NOTIFYITEMDRAW;<br />
break;<br />
<br />
case CDDS_ITEMPREPAINT:<br />
{<br />
if( nmcd.dwItemSpec == 3 )<br />
{<br />
LVCOLUMN stColumn = {0};<br />
stColumn.mask = LVCF_WIDTH | LVCF_FMT;<br />
for ( int nCol=0; GetColumn( nCol, &stColumn ); ++nCol )<br />
{<br />
CRect ColumnRect;<br />
GetSubItemRect( nmcd.dwItemSpec , nCol, LVIR_LABEL, ColumnRect );<br />
CRect ColumnRect2;<br />
CString csText = "some text";<br />
if( nCol == 2 )<br />
{<br />
GetSubItemRect( nmcd.dwItemSpec , ++nCol, LVIR_LABEL, ColumnRect2 );<br />
ColumnRect.right = ColumnRect2.right;<br />
csText = "merged text";<br />
}<br />
CDC *pdc = CDC::FromHandle( nmcd.hdc ); <br />
pdc->DrawText( csText, ColumnRect, DT_SINGLELINE|DT_LEFT|DT_VCENTER );<br />
}<br />
*pResult_i = CDRF_SKIPDEFAULT;<br />
return;<br />
} <br />
*pResult_i = CDRF_DODEFAULT;<br />
break;<br />
}<br />
default:<br />
*pResult_i = CDRF_DODEFAULT;<br />
break;<br />
}<br />
}
nave
|
|
|
|
|
Naveen R wrote: GetSubItemRect( nmcd.dwItemSpec , nCol, LVIR_LABEL, ColumnRect );
How can I find proper subitem rectangle to draw text??
Punita
|
|
|
|
|
whats wrong with the GetSubItemRect?
nave
|
|
|
|
|
Sorry,
Now It is work fine.
Thank you very much Naveen to give me reply.
Punita
|
|
|
|
|
pandyapunita wrote: Thank you very much
nave
|
|
|
|
|
can someone tell me how to insert Spanish language on buttons in my MFC aplication in Visual C++ 6.0 and how to type it in code in order to get message boxes in Spanish?
zzz
|
|
|
|
|
|
my platform is xp sp2 and vs2005. I downloaded the lastest platform sdk from microsoft website. But there is no declaration of GetExtendedTcpTable in iphlpapi.h. Then i check the output section of iphlpapi.dll, and there is.
My purpose is to make the program in static link, so i neek the dll link implicitly. Is there only way i use this function by linking the dll explicitly?
Thans for everyone who give me help.
|
|
|
|
|
|
Why you write a message without title
|
|
|
|
|
I don't know why there is another message without title.
I just write a message that you replied. So I really don't know how it happened.
Sorry!
|
|
|
|
|
Maybe you click Post Message before enter subject for your question
|
|
|
|
|
|
for the benefit of other users, here[^] is your post...
|
|
|
|
|
Hi,
I am parsing C files to identify variable usage using lex and yacc.
But I am facing problem regarding macros, since a macro definition may contain some variable name. Since its within body of macro, I am not able to track the variable usage.
So I wanted to know, is there any way we can get this macro preprocessing done so that we have our C file with all macros expanded?
Any thoughts or ideas on this...please let me know
Thanks in advance.
Abhijeet Jadhav
|
|
|
|
|
You can use the /P[^] option with Microsoft compilers.
Steve
|
|
|
|
|
Thanks a lot Stephen!
I think that should work...I will try out this compiler switch.
Abhijeet Jadhav
|
|
|
|
|
I am using a CMap
CMap<cstring,lpcstr,int,int> my_map;
my_map.SetAt("abc",1);
my_map.SetAt("xyz",22);
...
I need this map to be globaly accessible in my application, therefore I am initialising this in a common header file of my application.
But when i compile the coe I get following errors:
: error C2143: syntax error : missing ';' before '.'
: error C2501: 'my_map' : missing storage-class or type specifiers
: error C2371: 'my_map' : redefinition; different basic types
: see declaration of 'my_map'
Any pointers?
|
|
|
|
|
~Worried! wrote: error C2143: syntax error : missing ';' before '.'
: error C2501: 'my_map' : missing storage-class or type specifiers
CMap is declared in afxtempl.h , you need to include that file.
~Worried! wrote: I need this map to be globaly accessible in my application, therefore I am initialising this in a common header file of my application.
In this case, use extern .
In common header,
extern CMap my_map;
And in one on cpp file define it.
i.e.
CMap my_map;
|
|
|
|
|
prasad_som wrote: CMap is declared in afxtempl.h, you need to include that file.
Even then the error does not go.
Actually there is no seperate .cpp file here. This header file contains all the constants etc required in my app. I just want to associate some key-value pairs so that they can be searched some time later in the applicataion.
|
|
|
|
|
~Worried! wrote: CMap my_map;
where is key value pair
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
ThatsAlok wrote: where is key value pair
In the same header file.
|
|
|
|
|
I dont' know how to named the title!
My program is compiled by vc6+sp6+SDK2003 with release mode but have debug information in it
And there is a static member called A(faked name).
And is a instance of class CSite.CSite is inherited from a abstract class.
example:
class Base
{
void virtual int add(int a,int b)=0;
};
class CSite:public Base
{
//blablabla...
};
When debug the program and set a breakpoint at the construtor of the member A.
I found that the vtable pointer was initlialized to NULL.
And of course the program crashed!
I have no idea with this issue!
Can any one who please give me a handle on this!
BTW:there is not anything wrong if I debug the program in debug mode!
Thank you very much!
I must appologise for my poor english,hope you can understand what I said!
-- modified at 23:47 Wednesday 31st January, 2007
Don't look at me in that way!
|
|
|
|
|
Can you show this "A"?
Steve
|
|
|
|