|
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
|
|
|
|
|
Hi,
I need to play swf file in VC++ application using flash ocx.
One condition is that, swf file should not be played if the user open the file in normal flash player. So something should be done at the flash side (I am not so clear about how to do that right now). But it should be played only from my application (A kind of protection from playing and so spreading the files discreetly).
(I am thinking about some method to pass some values to swf script. And there, if the passed value is checked and if it is OK then only allow to play the swf.)
I wish to get ideas from you. Probably some of you had gone through such a requirement...
Thank you.
|
|
|
|
|
|
Thank you...
But it is just about telling how to load the file. I can load the file by inserting the flash ocx in to my (MFC) application. There is no problem at all.
I actually need to make the swf file played only by my application. I know both the application side and the flash side need something to be done for that. So I wish to get ideas regarding this.
I am also googling for some solutions... but not got yet... so continuing the search...
|
|
|
|
|
NS17 wrote: One condition is that, swf file should not be played if the user open the file in normal flash player. So something should be done at the flash side (I am not so clear about how to do that right now). But it should be played only from my application (A kind of protection from playing and so spreading the files discreetly).
1) One method is to corrupt the file, which you know how to reverse back. All the SWF files formats start with "CWS". So modify your flash file by changing it to something like this - "CWT" or something like that. When you play the file, check whether the file starts with "CWT" and in that case reverse it to "CWS" and play. Once played, corrupt it again.
2) Another method is to encrypt the entire file and for playing in you application decrypt it back.
NS17 wrote: I need to play swf file in VC++ application using flash ocx.
Well, if you need to know how to play swf in VC++ application, then check out this tutorial - How to display Flash animation in Visual C++ MFC application[^]
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|