CHTMLView help needed

I have a CHTMLView and I want to save the output from it as a bitmap (or
some other image type) file.

Does anyone know how to render the content of the view to an image file
(IE5.5 and up)?

The normal standard Windows GDI based approach doesn't seem to work because
it only gets the area of the view that is visible and includes the view's
scroll bars in the output.  Is there away to get cleaner output rendered to
an impage file that doesn't have the scroll bars and shows the whole
content, not just what is currently visible onscreen?
----------------------------
I know one of you really smart people out there knows how to do this.  You
are torn between wanting to help and show off what you know and between your
real job.  Come on... how many nights have you stayed late fixing a bug and
nobody knew how hard it was or even appreciated it.  How many times did your
boss give you a crappy raise, or put some idiot in charge of you?  How many
times did they bring you a half-baked design that cost 90% of the total
budget and then demanded to know later why the engineering stage was going
so poorly?  Here's your chance to get them back by dropping that and showing
me how to do this!  Unlike your boss I'll say thank you and really
appreciate it!!!


0
river.ross (102)
9/22/2003 4:01:17 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
766 Views

Similar Articles

[PageSpeed] 32

Come on I know this has to be possible somehow?  Nobody's done this before?


"River Ross" <river.ross@sbcglobal.net> wrote in message
news:h1Fbb.1497$rn.1009@newssvr23.news.prodigy.com...
> I have a CHTMLView and I want to save the output from it as a bitmap (or
> some other image type) file.
>
> Does anyone know how to render the content of the view to an image file
> (IE5.5 and up)?
>
> The normal standard Windows GDI based approach doesn't seem to work
because
> it only gets the area of the view that is visible and includes the view's
> scroll bars in the output.  Is there away to get cleaner output rendered
to
> an impage file that doesn't have the scroll bars and shows the whole
> content, not just what is currently visible onscreen?
> ----------------------------
> I know one of you really smart people out there knows how to do this.  You
> are torn between wanting to help and show off what you know and between
your
> real job.  Come on... how many nights have you stayed late fixing a bug
and
> nobody knew how hard it was or even appreciated it.  How many times did
your
> boss give you a crappy raise, or put some idiot in charge of you?  How
many
> times did they bring you a half-baked design that cost 90% of the total
> budget and then demanded to know later why the engineering stage was going
> so poorly?  Here's your chance to get them back by dropping that and
showing
> me how to do this!  Unlike your boss I'll say thank you and really
> appreciate it!!!
>
>


0
river.ross (102)
9/22/2003 5:03:11 PM
Hi,


Not smart to respond to your own initial posting if you really want a
response. I for one normally don't even look at questions that seem to have
responses already. I guess me isn't the only one.

The web browser control that is used as the underlying technology for
CHtmlView has the possibility to print to a bitmap. The word print here you
should really interpret as printing to pages, with all the settings that are
normally involved for that, like page sizes and orientation and such. (But
without the scroll bars and stuff that is nagging you now.)

This article describes a lot of promising printing stuff of the web browser
control:
http://msdn.microsoft.com/library/en-us/dnie55/html/wb_print.asp

What you might be looking for is called "Printing a Bitmap of a Web Page"
under "Printing Workarounds".

My personal experience with the whole printing stuff for the web browser
control is that it is rather difficult to set up and get to work. I stopped
exploring the bitmap printing solution at some point altogether, as there
was a much better solution for what I was trying to do at that time. But
also other approaches from that document that I needed to use seemed rather
unclear to me. Even now I've successfully implemented them :-S

Good luck,


Sander Verhagen
[   Verhagen@nonono.Sander.com   ]

"River Ross" <river.ross@sbcglobal.net> wrote in message
news:h1Fbb.1497$rn.1009@newssvr23.news.prodigy.com...
> I have a CHTMLView and I want to save the output from it as a bitmap (or
> some other image type) file.
>
> Does anyone know how to render the content of the view to an image file
> (IE5.5 and up)?
>
> The normal standard Windows GDI based approach doesn't seem to work
because
> it only gets the area of the view that is visible and includes the view's
> scroll bars in the output.  Is there away to get cleaner output rendered
to
> an impage file that doesn't have the scroll bars and shows the whole
> content, not just what is currently visible onscreen?



0
Verhagen (48)
9/24/2003 9:43:59 AM
Thanks for your response, its greatly appreciated and you are right about
posting to myself... I was just trying to egg somebody into giving an
answer, I was so frustrated that day.

I am already familiar with the article you discussed and had already
reviewed even prior to this current issue because I ussed IE to print in an
app and due to those known issues with the printing we finally made the call
to switch from IE based html reporting to Crystal Reports.

But that article does have a sample that tells how to take a bitmap of IE
which I had downloaded and tried.  First off if you have VC6 you have to
update your SDK because newer IE features aren't in the mshtml.h that
shipped with VC6 so that hung me up for a while.  But the sample has no
documentation that's thorough enough and even hints at certain limitations
without saying anything concrete (I believe it says users would have to
position the screen size etc before using this) which is really
disappointing.  When IE prints itself it does not need to maximize itself so
that it is visible etc so this is a really a sad example.

I know IE is a fancy complicated Com object and all that but still if MS is
embedding it in an MFC class and proposing it as a widget that developers
can use it would really be nice of them to give that some deeper thought and
actually support it in that capacity.

The IE browser control seems to be one of the most mysterious topics on this
board.  Over and over people post questions and typically nobody knows the
answer.  That's because it really has so little to do with MFC and totally
the arbitrary implementation of that com object which nobody has time to
decipher and which is too deep to apparently get simple answers.

I mean the fact that I can't programmatically call certain operations
without a dlg flashing in the users face due to security concerns shows that
little effort has gone into making it a decent widget... the control can't
even distinguish between client side scripting (where certain operations
would be restricted so that a web site couldn't run malicious code on you
machine) and when its embedded into a user's application where it should be
allowed to complete any operation.

I think this is really sad because underneath it all its the premier browser
out there.  Its really exciting that MS gave us the keys to this car and is
letting us take it for a spin our own apps.  Unfortunately its just not
being well supported in this capacity in my opinion.

I wish I could find a good CHTMLView faq or something.



"Sander Verhagen" <Verhagen@nonono.Sander.com> wrote in message
news:O8yviBogDHA.2184@TK2MSFTNGP10.phx.gbl...
> Hi,
>
>
> Not smart to respond to your own initial posting if you really want a
> response. I for one normally don't even look at questions that seem to
have
> responses already. I guess me isn't the only one.
>
> The web browser control that is used as the underlying technology for
> CHtmlView has the possibility to print to a bitmap. The word print here
you
> should really interpret as printing to pages, with all the settings that
are
> normally involved for that, like page sizes and orientation and such. (But
> without the scroll bars and stuff that is nagging you now.)
>
> This article describes a lot of promising printing stuff of the web
browser
> control:
> http://msdn.microsoft.com/library/en-us/dnie55/html/wb_print.asp
>
> What you might be looking for is called "Printing a Bitmap of a Web Page"
> under "Printing Workarounds".
>
> My personal experience with the whole printing stuff for the web browser
> control is that it is rather difficult to set up and get to work. I
stopped
> exploring the bitmap printing solution at some point altogether, as there
> was a much better solution for what I was trying to do at that time. But
> also other approaches from that document that I needed to use seemed
rather
> unclear to me. Even now I've successfully implemented them :-S
>
> Good luck,
>
>
> Sander Verhagen
> [   Verhagen@nonono.Sander.com   ]
>
> "River Ross" <river.ross@sbcglobal.net> wrote in message
> news:h1Fbb.1497$rn.1009@newssvr23.news.prodigy.com...
> > I have a CHTMLView and I want to save the output from it as a bitmap (or
> > some other image type) file.
> >
> > Does anyone know how to render the content of the view to an image file
> > (IE5.5 and up)?
> >
> > The normal standard Windows GDI based approach doesn't seem to work
> because
> > it only gets the area of the view that is visible and includes the
view's
> > scroll bars in the output.  Is there away to get cleaner output rendered
> to
> > an impage file that doesn't have the scroll bars and shows the whole
> > content, not just what is currently visible onscreen?
>
>
>


0
river.ross (102)
9/25/2003 5:29:00 PM
Reply:

Similar Artilces:

Excell help
What does it mean if you see ####### in a cell Column too narrow. Widen the column: Double-click on the right hand column border in the column title bar or drag that border to the right -- Kind regards, Niek Otten Microsoft MVP - Excel "Summersway" <Summersway@discussions.microsoft.com> wrote in message news:0762CB39-EFA8-4B33-B7C9-8EAF88FB1643@microsoft.com... | What does it mean if you see ####### in a cell It could mean a few things. 1. The columnwidth is too narrow to show the number. Widen the column or change the font size of that cell. Or change the ...

Formula Help
Can someone help me with the formula below. I can't figure out what I'm doing wrong. IIf(IsError([Label43] / [Text91]),"-", IIf(([Label43] / [Text91]=0,"-", [Label43] / [Text91])) Label controls don't have values. They have captions. If you are attempting to fix divide by 0 errors, the general syntax is: =IIf([SomeValue] = 0 , Null, [OtherValue]/[SomeValue]) BTW: do yourself a favor and rename your controls to values that provide some self-documentation. -- Duane Hookom Microsoft Access MVP "BBAL20" wrote: > Can someone help me with the ...

Help Me
I have 4 store and I HQ based on Windows 2003 Server. Last week I updated 2003 Server. After that, RMS Not worked with store client. for example, I approved style 206, 260, 307 but no RMS client server interact with RMS HQ Server Please help me thank you ...

CHtmlView and OnChar
I created an SDI app with CHtmlView as my view class, but cannot recieve WM_CHAR messages, or any keyboard or mouse messages for that matter. I tried routing them thru both the View and Main Frame class but it still doesn't work. Could someone please tell me if there is a way to use these messages with CHtmlView. Thanks in advance. Trap WM_CHAR in PreTranslate method. This particuler ActiveX control that is hosted in CHTMLView does not work as you expect with PreTranslateMessage or trapping WM_CHAR etc. There are couple of ways to do this. One is to automate the control and li...

DISTINCT ROW help needed
I have a code in the OnCurrent of a form that inserts the ID of the company for that record into a table. The purpose of that table (LastVisitedRecord) is a history of sorts. On that form, I have a combo box that uses the following sql as row source - SELECT DISTINCTROW ProspectTable.Company FROM ProspectTable INNER JOIN LastVisitedRecord ON ProspectTable.ID = LastVisitedRecord.lvCompanyID ORDER BY LastVisitedRecord.lvID DESC; The problem is, if i visit company Acme, Inc. a second time, it still shows the first instance (at the bottom of the list) and I want it to show the last instance as t...

need advice on Edit control
Hi all, I am using MFC application VC++.Net 2003,. I have a dialog based application. I want to show some text to the user in my dialog control like "ABCDEFGHIJKLMNOP". the user should be able to click on any of these characters , and that clicked character has to be captured. I am actually confused how should I do it if I use an Edit Control? or Is there any other way I can do it. Please Suggest.. Thanks!! Sweety By "captured" do you mean copied to the clipboard or just identified? If you mean identified you may want to use something like radio buttons or a drop dow...

HELP!!! #3
First, I was unable to display my Outlook folder. I couldn't go to Detect and Repair because I couldn't open Outlook. I proceeded to scanpst.exe to repair the problem. Now I've lost all my email messages. Did I lose everything? How do I restore the messages? I checked the box to save it in a file but where is that file? Please help quickly. I run a small business out of my home and need to find this info fast. ...

Help with CMainFrame and Views
Hello! I need a bit of help. I am getting mad just trying to print something in the status Bar. I have a MDI aplication and I want to update the StatusBar with the mouse's coordinates of any view. In the format: X:%d Y:%d. The variables int m_x and int m_y are declared public on the MainFrm.h. My only question is: When I try to get a pointer to the CMainFrame class from any of the views my program get mad. I just want to update the values of m_x and m_y. How can I do it? I have tried the following: void CPFCView::OnInitialUpdate() { m_pWindowFather= (CMainFrame *)GetParentFrame(...

MSScriptControl.ScriptControl help
Her is my powershell code: $vbsCode = Get-Content "c:\scripts\CreateMailbox.vbs" $vbs = New-Object -ComObject MSScriptControl.ScriptControl $vbs.language = "VBScript" $vbs.addCode([string]::Join("'n",$vbsCode)) #$vbs | Get-Member $vbs.CreateMailbox() Here is my vbscript code: Function CreateMailbox(Server,User) Dim oExchsrv Dim sDispName oExchsrv = Server sDispName = User Set oUser = GetObject ("LDAP://cn=" & sDispName & ",ou=New Accounts,dc=stormontvail,dc=org") WScript.Echo sSamAcct & " mailbox cr...

Help?
This is pretty detailed, I hope you can follow my train of thought. Normally I would attempt to do this in Access, but since the participants in this project do not have the program or the ability, we will need to do it in Excel. I can't get my brain around where to begin or what tools to use on this one. I think I'm just overwhelmed. We have manually placed in formulas and such to get us through #2. I'm just not sure where to go from there that would be easy for me to get to work and for the end users who have limited skill working with Excel. Also, once this is programed to give ...

Help With Macro Modification
Hello, I have this macro which will copy a group of non-contiguous cells to another sheet. What I would like to know, is it possible to also make it when it paste to new sheet, paste it as a "paste link". I need to be able to change info on original sheet, but udate cells on other sheets as a paste link routine. Thanks JR Sub CopyMultipleSelection() Dim SelAreas() As Range Dim PasteRange As Range Dim UpperLeft As Range Dim NumAreas As Integer, i As Integer Dim TopRow As Long, LeftCol As Integer Dim RowOffset As Long, ColOffset As Integer Dim NonEm...

Need help using COM control
My projects are all VC++ 6.0, MFC. I have in the past imlemented third-party ActiveX controls in various projects. I now need to interface with another company's product. Their developer has given me a DLL he developed with Visual Fox Pro. He's given me an Excel VBA example that works. How do I make the DLL usable as a control in my MFC project? Thank you for help. Tom Salicos Tom S. Lee wrote: > My projects are all VC++ 6.0, MFC. I have in the past imlemented > third-party ActiveX controls in various projects. I now need to interface > with another company's p...

HELP!!!! Can't figure problem out
hello... and thank you in advance to anyone that can assist me with my problem... I'm running Outlook 2000 on XP connecting to an internal Exchange 2000 server... When some of the workstations start up Outlook they get the following error "Your Microsoft Exchange Server is unavaliable You can retry connecting to the server using the network, or work off-line and connect using dial-up networking. The network did not respond in a timely fashion to determine the existance of an Exchange Server, you may retry and continue waiting for a responds or work off-line" If you se...

CHtmlView
We have a CHtmlView with two fames in a MFC application. <html> <frameset cols="30%,70%"> <frame name="menu" ...> <frame name="detail" ...> </frameset> </html> on the menu frame there are some links. when you click the link, we use Navigate2() to request a .jsp page and put it in the detail frame. I know CHtmlView::GetReadyState()==READYSTATE_COMPLETE means the view is at ready state. I want to know when the detail frame is ready. I tried GetReadyState(). It didn't work. It always return me READYSTATE_COMPLETE ...

Dynamic Filtering...Need Help
Using Version Excel 2003 I have a report that retrieves different data based of data validation. In each case there are rows that have no data and I want these hidden when the user selects another data set based on their validation selection. To do this I am using the auto filter function. The issue I am running into is that each time a user selects a new report view they have to re-filter. Is there a way, without using a macro, to have the filter re run based on the users new selection withough having to re-filter? ...

CRM migrating
Hi all. I am a contract System admin for a company. They decided to fast track their program and move their CRM server which we currently host inhouse to a datacentre(hosted on VMware). The person who does their IT work is on a vacation - and he told me that I would need to do AD replication. But i dont understand WHY. How i understand it is - i would need to replicate it IF the CRM server was on a DIFFERENT domain, correct? and then I would need to replicate and sync with that domains PDC? Please help. Iv spent the last few weeks trying to find info on CRM and AD replication but no...

? Both Help Box AND Minimize Box in Title Bar of MFC Dialog App
Hi, I assume that this question has been asked before but since I can't find it anywhere... How can you put both a question-mark context-sensitive help button AND a Minimize/Maximize Box in the title bar of a Dialog mode MFC app? Thanks -- Alec asoroudi@synetech.cjb.net ...

pst help
I had an outlook pst file of about 1gig on my desktop and using a backup program backed it up and then imported it into my laptop (for the first time) which took over an hour. I cleaned up (deleted) some emails in my inbox (from about 4,200 emails to 3,700) I then exported the file from my laptop and then imported that file (still about 1 gig) back to my desktop. The import did not reflect the email deletions I made on the laptop though but the pst file size jumped from 1 gig to 1.8 gig. I don't see any duplications in my emails or contacts. I'm using Outlook 2003. I would like to get ...

Help with batch production and Solver
Hi and a happy new year! I still got problems with an production optimization. In the attached excel file you will find demand data, maximum and minimum stocks, production capacity and stocks for 13 months I need to satisfy demand each month by the use of stocks, new production or purchase. The use of stocks is the cheapest alternative and purchase the most expensive alternative. The sum of provided quantities times costs should be minimzed. My problem is the following: The production should happen in batches of at least 500 pieces (if capacity is sufficient) or should be zer...

scrolling
How do i scroll in two workbooks at the same time? Sort of mirrored scrolling for two open spreadsheets... in Excel 2002? ...

Read Reicept Help
I am getting this error, when trying to respond to an email in outlook espress, when it requests a read reicept. outlook unable to send reicept Please help. Unable to send read reicept. Thanks! Amanda ...

Help! charts disappearing, new charts crashing powerpoint
When i open a presentation the charts vanish...i have restarted, they come back. I try to edit a chart, and it crashes powerpoint after a few clicks. What can I do...whole afternoon going crazy! If you are using v 2007 there is a hotfix which is meant to cure some chart crashing problems http://support.microsoft.com/default.aspx?scid=kb;en-us;976479&sd=rss&spid=11264 -- john ATSIGN PPTAlchemy.co.uk Free PPT Hints, Tips and Tutorials http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html "UKExcelgeek" wrote: > When i open a pres...

Macro That doesn't work
I have a macro which converts urls in a column to the words "Tax Record" but the macro will not work. When I run the Macro it prompts for Column and then prompts for sheet name as expected. When valid inputis given to both questions the Macro ends without error but does not convert the urls in the column identified into the words "Tax Record" I would appreicate any help I can get. The Marco is: Sub chngelink() ' ' chngelink Macro ' ' Keyboard Shortcut: Ctrl+z Dim MyCol As String Dim MySht As String On Error Resume Next MyCol = InputBo...

I need a better way to stop an application.
My program needs a utility program to be running. So when my program starts, it does a CreateProcess to start the utility program. When my program terminates it does a ::FindWindow to get the utility program's window. It uses the utility program's title bar text. It then does a PostMessage of a registered message which the utility program then gracefully exits. Also when my program thinks the utility program has stopped working (for whatever reason), it does the same stop proceedure and it then restarts the utility program by doing a CreateProcess. Usually the code works. But ...

Importing Contact
Hi, I've recently installed MS CRM standard edition. I've got database of contacts (from goldmine, which i can export to excel as well). Any idea how to import the basic contact information like Name,address,phone,fax and the like to the CRM application? Thanks, Ash From the Tools Menu goto Import --> Contacts It easily imports Text files and it lets you match up your fields to the fields in CRM. There might be an easier way to get your data in, but this is how I've done it. Export the goldmine data to an excel file. In Microsoft Access import the excel file and cr...