IHTMLDocument::Write method problem

Hello EveyOne
I am using IHTMLdocument and its method. My aim is to extract the body
of a IHTMLDocument after loading  the local html page ( saved file )
to IHTMDocument. So I just read the file into buffer , created a safe
Array and used IHTMLDocument::write method to write the contents of a
file to IHTMLDocument. It worked fine for many web pages, But when I
tried it for web page
application became NOt Responding.When I debugged the application , I
found that the IHTMLDocument::write method never returned and thats
why my application was going into Not Responding state.COde of that
function is given below.Any help appreciated !

BOOL CHtmlHiddenView::LoadHTMLDocument()

IHTMLDocument *pDoc;
HRESULT hr=CoCreateInstance(CLSID_HTMLDocument ,
                            IID_IHTMLDocument2 ,

        if (SUCCEEDED(hr) && pDoc)

        CFile f;
        HRESULT hr;

        //let's open file and read it into CString
        if (f.Open("C:\\sample.html", CFile::modeRead |
                // Open the file and read the data into buffer
                CString csWholeFile;

                // Write data into HTMLDocument
                SAFEARRAY* psa = SafeArrayCreateVector(VT_VARIANT, 0,
                VARIANT *param;
                CComBSTR bsData = (LPCTSTR)csWholeFile;
                hr = SafeArrayAccessData(psa, (LPVOID*)&param);
                param->vt = VT_BSTR;
                param->bstrVal = (BSTR)bsData;
                if (pDoc)
                        hr = pDoc->write(psa);//Never returns ...
                        hr = pDoc->close();

                        return FALSE;

                return TRUE;
                return FALSE; 

ajay8436 (23)
2/9/2005 4:29:40 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 52


Similar Artilces:

WAB and Office 2k3 problem
Greetings All: I've Outlook 2003 connected to an Exchange 2003 server. The only addresses that appear in my address book are the Global Addresses from the server, my contacts do not appear. Now when I go to the appropriate "Outlook Address Book" tab in the contacts properties dialog, the "Show this folder as an e-mail Address Book" checkbox is grayed out. I have several other contact folders that exhibit the same grayed out checkbox. If I try to add them from the Options dialog in the Address Book specifically, they don't even show up in the as being avail...

money 2006 problems importing from bank
whenever I import information from my bank uccu, it says that the import is complete and that I have one statement to read with 150 transactions to review, but when it opens to the account register, none of the new transactions show up. It shows the correct amount and date from my bank in the left hand corner, and it says that I still have 150 transactions to review. I have tried changing the online settings, emptying the temporary internet files, repairing the money file, and setting the account register to show all transactions, but so far nothing has worked. I have been able to i...

Money2004 (No MSN, no Passport) -> Monwy2006 Any problems?
I use M2004 without MSN, Passport or passwords. My financial institutions (Citi cards, Fidelity, Bank One) download into M2004 without any problems. Will I be able to transition into M2006 without any problems? I'll be happy to maintain the current M2004 features and capabilities. I'm thinking of M2006 only because the on-line stuff for M2004 will expire next year. -- Aloke ---- to reply by e-mail remove 123 and change invalid to com I imported without a problem but cannot now use MSN. I did not before and did not have a Passport. Adding the Passport works but synching with MS...

MSCRM Opportunity's to allow price override and write in products
The Opportunity functionalirty should allow users to over-ride the price list values as per the quote functions. Additionally the option to have write-in products, again as per the Quotes functionality, should exist as part of the standard Opportunity functionality. This therefore gives the sales person flexibility is pricing the products to suit the client and also include products that are not standard price list items ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I...

Where Does Outlook Store Info? Computer Problems
Recently the power supply, motherboard, & CPU on my computer died. So I had a new motherboard, power supply, CPU and hard drive installed. The new hard drive is larger and faster than the old one. This required that Windows XP, Microsoft Office, etc, had to be installed. But before any of that was done, the technician took everything off the old hard drive and saved it into a file on the new one. All of the old data files, etc, are supposed to be there. My question, though, is how to find the address book and the saved emails that were on the old computer & put them into Outlook on the...

Update Download problem
I downloaded the latest update for Outlook 2000. I did NOT have the installation cd handy. Okay, usually no problem, the instal quits. However this time, it did quit, yet now I am unable to open excel. It launches the instal program. The download was for Outlook. It has me boggled. Outlook, Word and Access open with no known problems. I have tried to open excel different times/ways. It continues to try to load the update. Any reasoning on the subject??? Thanks* ...

Bank Recon GP 10 problem
Hi We are a VAR that's upgraded one client to GP 10 and installed GP 10 for another new client, both on SQL 2000. In both cases there's an incorrect balance showing for Cashbook Balance field (cashbook maintenance screen) using the Bank Recon module. Also the cashbook balance is not re-calculated (recon screen) when "Incl Trans To Date" field is changed, for both clients. We can update the balance in Cashbook Master table (CM00100) in SQL but this doesn't solve the problem. Any suggestions? ...

Protection Problem #3
I have a 3 sheet excel file with protection on all 3 sheets (let's call them A, B and C). These 3 pages have formulas that link to each other. Sheet A has a few checkboxes that link to sheet C. The problem is that when I try to check any of the check boxes on sheet A an error box pops up that says "The cell or chart you are trying to change is protected and therefore read only". Is there a way to protect a sheet while being able to check a box off that is linked to another sheet? What protection options would allow me to do this? Thanks in advance. Dave -- Dave123 ----------...

Connectivity Problems
Sorry about the length of this post, but I have no idea what I'm talking about, let alone explain it! We have two sites (Head Office and Remote) with a Netgear FVS338 VPN firewall at each end. The remote site connects via a Terminal Server and runs a couple of EPOS systems. Our setup in the Head Office is thus: Workstation -> SBS 2003 R2 Standard -> FVS338 VPN Firewall -> Internet Router Recently, the VPN keeps dropping and if I set up a permanent ping I can see that several times a day we get 7 or 8 pings timing out. This is enough to kill the EPOS connect...

Timesheet Problem #2
I am trying to populate a timesheet with dates depending on the start date in B2. If B2 is the 16th of the month of Sept, I don't want anything to show up on the calendar for the 31th (blank in other words). Here is the formula I am using, but not working. Help. TIA =IF(($B$2)="","31",IF(EOMONTH(B2,0)=TEXT(($B$2)+ROW()-14,"DDD dd"),"",TEXT(($B$2)+ROW()-14,"DDD dd"))) Greg Hi Greg, With seed date in cell $B$2 and using rows down to leave the 31st blank. But show all other dates no exceptions for weekends and holidays. EOMONTH is in ...

problem with csv
When I export from a database I get the top line all in csv which appears to be in row A (which is the names of all the columns and the rest of the sheet is correct with all the data in relevant columns. How do I split that top row (which is Comma Separated) into coulumns automatically. I'm sure it is a simply process. thanks plato There is an easy way in Excel to split apart a cell without having to re-type its contents. Click on the cell. Pull-down Data > Text to Columns... > then check delimited and next check comma. The single cell should then split. Good Luck -- G...

Multiple problems with WLM
Multiple problems with WLM I realize that this problems list is long enough that it's unlikely that just one person will be able to solve them all. Therefore, it's OK to reply only for the one you can handle. Since some of these problems may be related, I decided to list them all in one post. 1. The All news view in the Quick views is either mislabelled, or unable to handle very large collections of unread newsgroups posts (I first saw this problem when the count was over 1,000,000, WLM was restarted, and the count dropped much lower (under 50,000). Since then I&#...

Moving Range Problem
Hi all, I'm trying to build a 6 Sigma control chart into an excel workbook. In order to do this i need to be able to work out a formula for the moving range. I need the following : Eg Data sample : 210 , 425 , 600 , 550 , 450 , 470 The moving range is the distance from second to the first, third to the second etc eg A B C D E F Data Sample 210 , 425 , 600 , 550 , 450 , 470 Moving Range 215, 175 , 50 , 100 , 20 The problem I'm having is trying to get excel to work it out. If say 210 was in A1 i ...

Allocation Method set to None
Not sure I understand Allocation Method set to None. Orders must be allocated before they can be fulfilled. So what exactly does setting Allocation Method set to None do? How then does the order get allocated? Thx ...

Pivot Table Refresh error "Problems Obtaining Data"
I can't seem to get data or change the data source. When I refresh, I get the error message "Problems Obtaining Data" When I start the Pivot Table Wizard, the back button is grayed out so that I can't go back and change data sources. Any help is appreciated. ...

DataSet write xml
Hi, I have observed that DataSet.WriteXML() method does not store "Allow Zero Length", "Indexed", and "Required" properties of the fields of a table in the table schema. dataset.WriteXml(stream, XmlWriteMode.WriteSchema) How do I instruct WriteXML() method to include these information along with field name, type and size? <xs:element name="field1"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="64" /> </xs:restriction> &...

Admin Problem from 5.5 to 2k3 Exchange
We just migrated all of our email boxes to Exchange 2k3 from Exchange 5.5. Now our administrators can't look at any of the users outlook information unless they are given the rights from that users. Before the administrators could look at the persons information and remove or help the people with problems and questions if need be. How can our Administrators gain access to these exchange boxes again? There are several articles out there on this. In E2K3, domain admins and enterprise admins are explicitly denied this access. There are work arounds. try this: http://www.winnetma...

I am having big problem manipulating XML in a dataset. I am reading in a schema based on the following XML document. The minute I try to e.g. create a new row I get 'Object reference not set to an instance of an object' error <?xml version="1.0" encoding="utf-8"?> <DocumentElement xmlns="http://tempuri.org/dseditted2.xsd"> <TableInfo> <FieldName>column value</FieldName> <ControlType>column value</ControlType> <IsNull>column value</IsNull> <MaxLength>column value</MaxLength> </TableInfo&g...

Problem with external data and #reference error
Hi, my Excel workbook has 2 sheets: 1. Source: with an external data reference to a MS Access database Query property "If number of rows changes after refresh" is set to option #1: "Insert cells for new data, delete unused cells" User chooses external query selection criteria and therefore can have different result sets. 2. Target: Formular B4: =Source!P5 Formular B5: =Source!P6 Formular B6: =Source!P7 Problem: When Source has data in rows 5, 6 and 7 formular gets calculated correctly. If Source row #5 has data and #6 and ...

Problem with copying and pasting tasks and keeping predecessors in
I am doing a consulting project for an organization that has a bit of an unusual request. We are doing a conversion from an old mail system to Microsoft Exchange 2007. We have developed a checklist for the technicians to follow with about 50 detailed tasks (things like, "Open up Exchange Management Console", "Assure the 'Forward' Button is unchecked", etc.). The CIO expects me to enter each of the tasks from the checklist into the project plan. Instead of having a line on the project plan with a task, "Covert Leroy Smith's Mailbox" wi...

Charting Problem #2
I have a problem with charting a Dynamic chart. I goes ok to set up the dynamic function as a range. It also shows the correct series. The range is as follows: =OFFSET(Sheet3!$A$1;1;Sheet3!$P$2-1;COUNTA(INDIRECT("C"&Sheet3!$P$2;FALSE));1) Where P2 is an input from a listbox, and the name of the range is: Sheet3!Dato. When I try to change the reference for the series i get the following message: "Your formula contains an invalid external reference to a worksheet. Verify the path, workbook, and range name or cell reference are correct, and try again." The serie...

Case strFormat = acFormatRTF, Problem
All my other Case scenarios are working except fpr "Word". But word is working on another case code on another form Can any see why this word not work? Case "WORD" strFormat = acFormatRTF ------------------------------------------------- Private Sub SendMailButton_Click() On Error GoTo ErrorHandler If Me.Dirty = True Then Me.Dirty = False End If Dim lngID As Long, strMail As String, strBodyMsg As String, _ blEditMail As Boolean, sndReport As String, strCompany As String Dim msgPmt As String, msgBtns As Integer, msgTitle As ...

XmlDataDocument problem
Hi, I have a problem reading xml into a dataset using the XmlDataDocument. In a test project, I created the following xml file: <?xml version="1.0" standalone="yes"?> <Customer> <OrderDetails> <OrderID>5</OrderID> <ProductID>6</ProductID> </OrderDetails> </Customer> And I use the following code to read it: TestDataSet ds = new TestDataSet(); // TestDataSet is a typed dataset with 1 table "OrderDetails", with 1 column "OrderID" System.Xml.XmlDataDocument doc = new System.Xml.XmlDataDocument(d...

Outlook Calendar views problem
Hey all... going to describe this to the best of my ability... but its one of those 'a picture would be worth a 1000 words' deals. Outlook Calendar views. We have a calendar shared among our entire company. In that Calendar we wish to create a timeline view availbale to anyone with permissions to view the calendar. We have created this view called 'timeline' and it appears that it is available to users of that folder. Sort of. Its there, but in teh outlook calendar / shared calendar / views pane, the view will ONLY show up when the calendars are in a timeline state as oppose...

Problems with Lead/Contact sharing?
Has anyone else had problems with Leads/Contact sharing themselves between users for no reason? We're having some issues where our leads/contacts are randomly being shared between SCs and TSCs. Doesn't make any sense at all... We had the same problem with Opportunities being shared without anyone actually sharing them. We poked around at it a bit and discovered that when a record is Assigned to another sales person, the person doing the assigning is automatically setup with sharing on that record. Our problem is that we can't seem to figure out how to get rid of the sharin...