|
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.
|
|
|
|
|
Jijo raj wrote: 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.
This is a good idea...
But please don't feel bad, I would like to take this as a last resort... Because if I get some other direct method, I will follow it...
Jijo raj wrote: 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[^]
Actually I know how to play the swf in VC++. But have no better experience...
Thank you very much for sharing your thoughts...
|
|
|
|
|
NS17 wrote: But please don't feel bad, I would like to take this as a last resort... Wink Because if I get some other direct method, I will follow it...
No Problem mate. And I sincerely wish for someone to come with better idea!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Probably I may use your idea... no better method than this got yet...
BTW, could you tell me the basics of the way to decrypt (no need to describe about decryption methods) a file in memory than creating an actual file. I need it because if I create the temporary file in the disk, then possibility is there to get that file to the user as it is... (then he/she can play it directly)
|
|
|
|