|
Why are you calling SubclassWindow?
If you're using MFC you very rarely need to explicitly call it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Where is this code called from? You really need to provide a context.
If SubclassWindow is the CWnd SubclassWindow method, then what's the class you are
calling it from?
SanjaySMK wrote: which fails here, why?
Why don't you step into the function with the debugger and find out?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have a method in CListCtrl-derived class, from where I am calling CWnd::SubclassWindow, and after calling that, WM_LBUTTONDOWN and WM_LBUTTONDBLCLK do not get called at all.
Software Developer
Sanjay Khapre
|
|
|
|
|
You still haven't answered WHY you are calling SubclassWindow.
Where do the CListCtrl derived objects come from? Show some code.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
CListCtrl derived objects come from the parent class, i.e. the dialog class, I call one member function of CListCtrl-derived class, SubClassMyList, in which I am calling SubclassWindow(HWND) function, after which mouse events don't work on this derived class.
Sorry, I was away for some days, hence couldn't update you quickly.
Software Developer
Sanjay Khapre
|
|
|
|
|
SanjaySMK wrote: in which I am calling SubclassWindow(HWND) function
I don't know how many times I've asked why...
All my MFC controls for the past decade have got mouse messages just fine without calling subclassWindow...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Dear Mark,
First of all, I am very sorry if I have tested your patience, although unknowingly and unintentionally. I have some big code of my project, which was running fine in Visual C++ 6.0(in which it was first written), but which I now needed to convert to Visual C++ 2005. After everything I have explained till date, since the functionality(mouse events) after conversion is not running in VC 2005, I created my own MFC application in VC 2005, in which, like the project code, I tried using CWnd's SubclassWindow(HWND). Since this functionality was running in VC 6.0, I need to keep and also make it run in VC 2005. Hence the inclusion of SubclassWindow also in my code(the sample application which I am trying these things in). I hope I am very much clear this time. Could you please help?
Software Developer
Sanjay Khapre
modified on Friday, January 16, 2009 12:45 AM
|
|
|
|
|
Hi,
In my MFC SDI application, there is a "File | Print" automatically created from the wizard which prints my CHtmlView successfully.
Now I would like to issue this command *manually* from my view.
Which method do I need to call?
Thank you!
|
|
|
|
|
Is ShellExecute (with verb "print") helpful ?
Regards,
Paresh.
|
|
|
|
|
Hi,
I do not think so; I have dynamic HTML code written to my CHtmlView which I want to print the same way as with File | Print.
I tried a little bit with ShellExecute but it does not work as expected.
Regards,
Niki
|
|
|
|
|
Use this code snippet to print your view from anywhere. The core idea is to call CView::OnCmdMsg() by passing ID_FILE_PRINT or ID_FILE_PRINT_DIRECT .
CFrameWnd* pFrameWnd = (CFrameWnd*)AfxGetApp()->GetMainWnd();
CView* pView = pFrameWnd->GetActiveView();
if( pView != NULL )
{
pView->OnCmdMsg( ID_FILE_PRINT, 0, 0, 0 );
}
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thank you, I think this is exactly what I was looking for
I'm inside my view anyway, so
this->OnCmdMsg( ID_FILE_PRINT, 0, 0, 0 );
does exactly what I want
Regards,
Niki
|
|
|
|
|
In the below code i have just inserted one item.
But no image appearing on the list ctrl item why?
m_ImageList.Create(IDB_IMAGES, 16, 1, RGB(255,255,255));
m_ListCtrl.SetImageList(&m_ImageList, LVSIL_NORMAL);
LV_ITEM lvItem;
lvItem.mask = LVIF_IMAGE | LVIF_TEXT ;
lvItem.iItem = 0;
lvItem.iSubItem = 0;
lvItem.iImage = 0;
lvItem.pszText = _T("New Folder");
m_ListCtrl.InsertItem(&lvItem);
|
|
|
|
|
Please check your ListCtrl is in LVS_REPORT mode then first Insert column
|
|
|
|
|
You should use LVSIL_SMALL instead of LVSIL_NORMAL if the list control is in report view.
|
|
|
|
|
Yes its working now. Thanks.
|
|
|
|
|
You are welcome...
|
|
|
|
|
Hi,
I want the generate the following type of exceptions for testing purpose.
EXCEPTION_IN_PAGE_ERROR
EXCEPTION_INVALID_DISPOSITION
EXCEPTION_PRIV_INSTRUCTION
Could any one tell me how can I do it using C++.
Thanks in advance.
Manoj
|
|
|
|
|
Manoj C V wrote: I want the generate the following type of exceptions for testing purpose.
EXCEPTION_IN_PAGE_ERROR
EXCEPTION_INVALID_DISPOSITION
EXCEPTION_PRIV_INSTRUCTION
Could any one tell me how can I do it using C++.
Tried windows API RaiseException ?
|
|
|
|
|
Thanks for the reply.
Not by using an API. I want to simulate the real scenario. I am trying to generate the memory dump after the exception. So I wanted to simulate the real exception.
|
|
|
|
|
|
Hi all,
i want to increase hight of row for ListCtrl.
please tell me how can i do this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
"_$h@nky_" wrote: Hi all,
i want to increase hight of row for ListCtrl.
please tell me how can i do this.
I've added a post on this in my blog, have a look...
http://nibuthomas.wordpress.com/[^]
Tell us if this works!
|
|
|
|
|
Thanks.
its a great job.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|