|
You can put images in column headers? I'm going to look into that. I need something similar
Thanks man,
Mark
|
|
|
|
|
Yes found the old project. Used a ImageList and then:
HDITEM hItem;
ZeroMemory( &hItem, sizeof(hItem));
hItem.mask = HDI_IMAGE | HDI_FORMAT;
_pList->GetHeaderCtrl()->GetItem( nCol, &hItem);
hItem.iImage = nImg;
hItem.fmt = HDF_LEFT | HDF_IMAGE | HDF_STRING | HDF_BITMAP_ON_RIGHT;
led mike
|
|
|
|
|
Cool! Thank you!
It's as easy as tab controls
|
|
|
|
|
pc_dev wrote: how can this delta be inserted in header?
See this[^] article.
pc_dev wrote: Is it possible to have multiple lines in an item or subitem of list control?
See this[^] article.
/ravi
|
|
|
|
|
This feature is built-in to commctrl v6, see here for sample code: clickety[^]
|
|
|
|
|
Hello.
I hope that I am using the right place to post.
I am using a file format with a simple file myfile.x and a corresponding data directory with multiples files under.
I want to link my .x file to the directory.
Like Internet Explorer do when I save an html file to disk : it create an html file and a data directory aside. If anybody delete the file : it also delete the directory.
Do anybody known a way to do that ?
(I am under Visual C++ 6)
(With CopyHookHandlers?)
Thanks for your help.
Kcm.
|
|
|
|
|
I have a grid window with one row is a multiline edit field. This row is a class derived from CEdit. The vertical scroll bar is enabled. The field is initialize with a long string. The first tiem the mouse clicked on this field, the field displays the string properly with the line wrap and the vertical scroll shown and active. The second time the mouse focus is back to this CEdit field, the field lock up, no scroll bar is visible. The grid is derived from Stingray's Objective Grid library 7.01
The lock up only happy when running the code in Release mode. If I step through or run the program in debug the problem does not occur.
Does anyone know of a similar problem and how to fix this? Thanks in advance
|
|
|
|
|
A Program in debug or release build must work similarly. once i had a similar problem, i delivered the debug version because it was behaving accordingly. it has nothing to do with grids or any thing else, it looks like VC6 bug (i think).
|
|
|
|
|
|
Thanks. Your answers gave me idea to build the Release version with /D _DEBUG instead of /D NDEBUG. Looks like it solves my problem.
Before, I suspected that optimization had something to do with the problem. I tried turn off optimization but it did not work.
Thanks for all your replies. I am grateful.
|
|
|
|
|
|
tieng86 wrote: Your answers gave me idea to build the Release version with /D _DEBUG instead of /D NDEBUG. Looks like it solves my problem.
Sorry to hijack the thread, but that just masks the problem, it's not a solution.
If just changing that define (/D) fixes it then maybe you've just improperly used the debugging
macros (like ASSERT).
|
|
|
|
|
That's another idea. I used ASSERT, VERIFY and TRACE. I search thru these calls and did not see any problem. Can you give me an example of an improper use of these macros? I've traced the code to the MFC layer and did not find any problem. The lock up just occured when I run the .exe. If I step thru the release build in codeview, it would not happen either.
here are some examples of how I use assert and verify
ASSERT( accessRight != ACCESSInvisible )
ASSERT( 0 );
ASSERT( pCtrl != NULL );
VERIFY(IsInit());
VERIFY(GridWnd()->OpenClipboard());
etc...
Thanks
|
|
|
|
|
Those look good. I'm referring to things like
ASSERT(GridWnd()->OpenClipboard());
that don't get compiled when _DEBUG isn't defined.
Are you linking with any DLLs that are built with _DEUBUG defined?
The article that toxcct linked to has lots of good tips.
|
|
|
|
|
Hi every body,
I am looking for a good starting point with MSXML.
I already compared several XML Libraries, and I think I want to give this one a try, but where to find doc ?
has anyone ever used it and want to give me his feeling about it too ?
thanks all
ps:I downloaded MSXML6
|
|
|
|
|
Have you looked in to MSDN ?
|
|
|
|
|
Hi prasad, yes I tried, but all I find on MSDN are tech docs, not tutorial. Do you have any relevant link ?
|
|
|
|
|
Not sure about tutorials, but you can have look at this[^] article .
Search at CP gives me this[^] result.
|
|
|
|
|
Dear All,
I am getting a Memory Leak. I am giving the Seniario.
Code.
//=======================================================================
CPictureHolder pic;
HICON hIconToDraw = mC_LibColorBar->mf_GetSelectedLibClrIcon();
//Get An Icon and store in hIconToDraw.
pic.CreateFromIcon(hIconToDraw);
//=======================================================================
The Statement
"HICON hIconToDraw = mC_LibColorBar->mf_GetSelectedLibClrIcon(); will load an Icon.
But there is a Memory Leak how can i Resolve this.
Urgent pls help me out.
//=======================================================================
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: mC_LibColorBar->mf_GetSelectedLibClrIcon();
What is mC_LibColorBar ?
How icon returned by mf_GetSelectedLibClrIcon() is create ?
Function name is really strange.
|
|
|
|
|
Hi Prasad,
The Statement "mC_LibColorBar->mf_GetSelectedLibClrIcon();" will return the ICon.
how can i delete that ICon, if i am trying to delete that Icon Handle then Asserion is comming.
If i dont delete then a Memory Leak is comming.
Uday kiran
|
|
|
|
|
Hi Prasad,
The Code i am giving will get you clear picture.
//====================================================
HICON CGTD2to32ColorWnd::mf_GetSelectedLibClrIcon()
{
return mf_GetLibClrIcon(mui_ColorSelected);
}
//=====================================================
which inturn calls this function
//=====================================================
HICON CGTD2to32ColorWnd::mf_GetLibClrIcon(long pl_LibClr)
{
CImageList *lpi_LibToolbarImageList = NULL;
HICON lH_Icon = NULL;
HICON lH_ReturnedIcon = NULL;
// Get the Toolbar internal imagelist.
if(pl_LibClr == ID_NOCOLOR_SELECTED && mb_ShowAllColorButton)
{
lpi_LibToolbarImageList = mC_wndAllColorToolBar.GetToolBarCtrl().GetImageList();
}
else
{
lpi_LibToolbarImageList = mC_wndColorToolBar.GetToolBarCtrl().GetImageList();
}
int li_BtnIdx = mf_GetLibButtonIndex(pl_LibClr);
// Extract the HICON from the toolbar's Image list for the currently selected
// Patten and return the same.
if(lpi_LibToolbarImageList)
{
lH_Icon=lpi_LibToolbarImageList->ExtractIcon(li_BtnIdx);
// Copies the lH_PattrenIcon into lH_ReturnedIcon and deletes the lH_PattrenIcon.
lH_ReturnedIcon = (HICON)(::CopyImage(lH_Icon,IMAGE_ICON,0,0,LR_COPYDELETEORG));
lH_Icon = NULL;
}
// Retrun the copied Icon.
return lH_ReturnedIcon;
}
//=====================================================
in short it will Copy the Icon using
lH_ReturnedIcon = (HICON)(::CopyImage(lH_Icon,IMAGE_ICON,0,0,LR_COPYDELETEORG));
and Return the Icon Handle
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: // Copies the lH_PattrenIcon into lH_ReturnedIcon and deletes the lH_PattrenIcon.
lH_ReturnedIcon = (HICON)(::CopyImage(lH_Icon,IMAGE_ICON,0,0,LR_COPYDELETEORG));
lH_Icon = NULL
You need to use DestroyIcon to free memory for icon created by using CopyImage .
So, use DestroyIcon appropriately in your code.
|
|
|
|
|
uday kiran janaswamy wrote: But there is a Memory Leak...
How are you verifying this?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi David,
In the Windows Task Manager GDI Objects.
1) i am clicking the Process Tab so i am getting the GDI Objects. where the Leak is Showing Clearly.
Please help me out.
Uday kiran
|
|
|
|