Click here to Skip to main content
15,914,500 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: DLL problem Pin
sudhir_Kumar9-Jun-08 20:10
sudhir_Kumar9-Jun-08 20:10 
GeneralRe: DLL problem Pin
Cedric Moonen9-Jun-08 20:30
Cedric Moonen9-Jun-08 20:30 
GeneralRe: DLL problem Pin
sudhir_Kumar10-Jun-08 1:47
sudhir_Kumar10-Jun-08 1:47 
AnswerRe: DLL problem Pin
Cedric Moonen9-Jun-08 20:29
Cedric Moonen9-Jun-08 20:29 
GeneralRe: DLL problem Pin
cristi_alonso9-Jun-08 21:10
cristi_alonso9-Jun-08 21:10 
GeneralRe: DLL problem Pin
Cedric Moonen9-Jun-08 21:25
Cedric Moonen9-Jun-08 21:25 
GeneralRe: DLL problem Pin
cristi_alonso10-Jun-08 1:07
cristi_alonso10-Jun-08 1:07 
QuestionDisplay HTML in CHtmlview in Vista Pin
john56329-Jun-08 18:55
john56329-Jun-08 18:55 
Hi,

I am displaying HTML using OnNavigateComplete2() method, inside this function I am using NavigateText()
function to dispaly HTML but at particuler point, program giving exception for some HTML text when I run the application using vista.
The function is
void CDisplayBody::NavigateText(CString pszText)
{
      try
      {
            if (!m_bHasDocument)                    // See if this is the first time in
            {
                  //m_strFirstText = pszText;           // Save the text for later
                  Navigate(_T("about:blank"));            // Initialize system to a blank screen
                  return;
            }

            // The DOM is now valid. Use the open() and write() methods
            // to set the entire screen's HTML.

            if (GetBusy())                          // See if it's busy with something else
                  Stop();        

            // Get a pointer to the HTML Document Object Model's interface
            //CoInitialize(NULL);
            IDispatch * pDisp = GetHtmlDocument();
            if (!pDisp)
                  return;

            IHTMLDocument2* pDoc;
            if (SUCCEEDED(pDisp->QueryInterface( IID_IHTMLDocument2, (void**)&pDoc )))
            {
                  // Empty URL and parameters opens the current document
                  CComBSTR    bstrURL;
                  CComVariant varDummy;
                  pDoc->open(bstrURL, varDummy, varDummy, varDummy, NULL);

                  // Create a safearray to store the HTML text
                  SAFEARRAY      *pSA;
                  SAFEARRAYBOUND  saBound = {1, 0};
                  pSA = SafeArrayCreate(VT_VARIANT, 1, &saBound);

                  // Copy the HTML into the one and only element
                  VARIANT   *pVar;
                  CComBSTR   bstrHTML = pszText;              // Load the text
                  varDummy = bstrHTML;                        // .. into a variant

                  SafeArrayAccessData(pSA, (void**)&pVar);    // Access safearray data
                  pVar[0] = varDummy;                         // Set the text data
                  SafeArrayUnaccessData(pSA);                 // Release access

                  // Write the HTML as the document's new text
                  pDoc->write(pSA);                           // Overwrite HTML
                  pDoc->close();                              // Update browser

                  SafeArrayUnaccessData(pSA);
                  SafeArrayDestroy(pSA);                      // Finished with the safearray
                  pVar=NULL;
                  
                  pDoc->Release();  // Don't forget to release the reference
                  pDoc=NULL;
            }//problem is here
            pDisp->Release();
            pDisp=NULL;
      }
      catch (...)
      {
            //AfxMessageBox(_T("CDisplayBody::NavigateText"));
      }
}


when control comes out the scope of if it opens a file named "atlcomcli.h" and point a statement
"HRESULT Clear() { return ::VariantClear(this); }" and program crash.

How can I resolved it?
AnswerRe: Display HTML in CHtmlview in Vista Pin
sudhir_Kumar9-Jun-08 20:18
sudhir_Kumar9-Jun-08 20:18 
QuestionHow to call .exe file ? Pin
nisha000009-Jun-08 18:38
nisha000009-Jun-08 18:38 
AnswerRe: How to call .exe file ? Pin
Naveen9-Jun-08 18:48
Naveen9-Jun-08 18:48 
AnswerRe: How to call .exe file ? Pin
SandipG 9-Jun-08 18:48
SandipG 9-Jun-08 18:48 
AnswerRe: How to call .exe file ? Pin
Mukesh Kumar9-Jun-08 18:49
Mukesh Kumar9-Jun-08 18:49 
AnswerRe: How to call .exe file ? Pin
hitonly20089-Jun-08 18:54
hitonly20089-Jun-08 18:54 
AnswerRe: How to call .exe file ? Pin
sudhir_Kumar9-Jun-08 20:12
sudhir_Kumar9-Jun-08 20:12 
GeneralRe: How to call .exe file ? Pin
Cedric Moonen9-Jun-08 20:32
Cedric Moonen9-Jun-08 20:32 
JokeRe: How to call .exe file ? Pin
Hamid_RT9-Jun-08 20:38
Hamid_RT9-Jun-08 20:38 
GeneralRe: How to call .exe file ? Pin
Cedric Moonen9-Jun-08 20:39
Cedric Moonen9-Jun-08 20:39 
GeneralRe: How to call .exe file ? Pin
Hamid_RT9-Jun-08 20:47
Hamid_RT9-Jun-08 20:47 
JokeRe: How to call .exe file ? Pin
toxcct9-Jun-08 21:04
toxcct9-Jun-08 21:04 
JokeRe: How to call .exe file ? Pin
Cedric Moonen9-Jun-08 21:08
Cedric Moonen9-Jun-08 21:08 
JokeRe: How to call .exe file ? Pin
toxcct9-Jun-08 21:19
toxcct9-Jun-08 21:19 
AnswerRe: How to call .exe file ? Pin
Hamid_RT9-Jun-08 20:17
Hamid_RT9-Jun-08 20:17 
AnswerRe: How to call .exe file ? Pin
Jagdish V. Bhimbha9-Jun-08 21:31
Jagdish V. Bhimbha9-Jun-08 21:31 
AnswerRe: How to call .exe file ? Pin
David Crow10-Jun-08 3:33
David Crow10-Jun-08 3:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.