Click here to Skip to main content
16,019,018 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: compile error when make a wchar_t conversion Pin
CPallini26-Nov-07 4:04
mveCPallini26-Nov-07 4:04 
GeneralRe: compile error when make a wchar_t conversion Pin
George_George26-Nov-07 20:46
George_George26-Nov-07 20:46 
GeneralNope Pin
CPallini26-Nov-07 22:23
mveCPallini26-Nov-07 22:23 
GeneralRe: Nope Pin
George_George26-Nov-07 23:31
George_George26-Nov-07 23:31 
GeneralRe: Nope Pin
CPallini26-Nov-07 23:50
mveCPallini26-Nov-07 23:50 
GeneralRe: Nope Pin
George_George27-Nov-07 3:44
George_George27-Nov-07 3:44 
GeneralOfftopic Pin
Nelek27-Nov-07 21:12
protectorNelek27-Nov-07 21:12 
QuestionVista problem with HtmlView Pin
john563226-Nov-07 2:41
john563226-Nov-07 2:41 
Hi Experts,
I have written a function that display the Html Content in HtmlView, this code is working fine on all the OS except Vista .This is working for some strings but does not work for some other string.And gives a unhandled exception.
I describe with code where the function throw exception.

void CDisplayBody::NavigateText(CString pszText)<br />
{<br />
	try<br />
	{<br />
		if (!m_bHasDocument)                    // See if this is the first time in<br />
		{<br />
			//m_strFirstText = pszText;           // Save the text for later<br />
			Navigate(_T("about:blank"));            // Initialize system to a blank screen<br />
			return;<br />
		}<br />
<br />
		// The DOM is now valid. Use the open() and write() methods<br />
		// to set the entire screen's HTML.<br />
<br />
		if (GetBusy())                          // See if it's busy with something else<br />
			Stop();        <br />
<br />
		// Get a pointer to the HTML Document Object Model's interface<br />
		//CoInitialize(NULL);<br />
		IDispatch * pDisp = GetHtmlDocument();<br />
		if (!pDisp)<br />
			return;<br />
<br />
		IHTMLDocument2* pDoc;<br />
		if (SUCCEEDED(pDisp->QueryInterface( IID_IHTMLDocument2, (void**)&pDoc )))<br />
		{<br />
			// Empty URL and parameters opens the current document<br />
			CComBSTR    bstrURL;<br />
			CComVariant varDummy;<br />
			pDoc->open(bstrURL, varDummy, varDummy, varDummy, NULL);<br />
<br />
			// Create a safearray to store the HTML text<br />
			SAFEARRAY      *pSA;<br />
			SAFEARRAYBOUND  saBound = {1, 0};<br />
			pSA = SafeArrayCreate(VT_VARIANT, 1, &saBound);<br />
<br />
			// Copy the HTML into the one and only element<br />
			VARIANT   *pVar;<br />
			CComBSTR   bstrHTML = pszText;              // Load the text<br />
			varDummy = bstrHTML;                        // .. into a variant<br />
<br />
			SafeArrayAccessData(pSA, (void**)&pVar);    // Access safearray data<br />
			pVar[0] = varDummy;                         // Set the text data<br />
			SafeArrayUnaccessData(pSA);                 // Release access<br />
<br />
			// Write the HTML as the document's new text<br />
			pDoc->write(pSA);                           // Overwrite HTML<br />
			pDoc->close();                              // Update browser<br />
<br />
			SafeArrayDestroy(pSA);                      // Finished with the safearray<br />
			pDoc->Release();  // Don't forget to release the reference<br />
			//pDoc=NULL;<br />
		}<br />
<br />
<br />
		pDisp->Release();<br />
		pDisp=NULL;<br />
	}<br />
	catch (...)<br />
	{<br />
		AfxMessageBox(_T("CDisplayBody::NavigateText"));<br />
	}<br />
}


As the fuction comes out the last if statement scope , it throw a exception.
Could you help me to resolve it or handle this error.
Question_snprintf_s in Windows Embedded XP Pin
janadhana26-Nov-07 2:13
janadhana26-Nov-07 2:13 
AnswerRe: _snprintf_s in Windows Embedded XP Pin
JudyL_MD26-Nov-07 2:35
JudyL_MD26-Nov-07 2:35 
QuestionVC++ Codec (h264) Pin
renoreballos26-Nov-07 2:02
renoreballos26-Nov-07 2:02 
AnswerRe: VC++ Codec (h264) Pin
Mark Salsbery26-Nov-07 6:02
Mark Salsbery26-Nov-07 6:02 
GeneralRe: VC++ Codec (h264) Pin
renoreballos26-Nov-07 16:42
renoreballos26-Nov-07 16:42 
GeneralRe: VC++ Codec (h264) Pin
Mark Salsbery27-Nov-07 7:21
Mark Salsbery27-Nov-07 7:21 
GeneralRe: VC++ Codec (h264) Pin
renoreballos27-Nov-07 14:40
renoreballos27-Nov-07 14:40 
QuestionHow to change the client wnd dynamically in SDI(no doc-view) Pin
followait26-Nov-07 1:51
followait26-Nov-07 1:51 
QuestionImage Skew(angle) Pin
sujtha26-Nov-07 0:33
sujtha26-Nov-07 0:33 
QuestionRe: Image Skew(angle) Pin
Nelek26-Nov-07 0:58
protectorNelek26-Nov-07 0:58 
JokeRe: Image Skew(angle) Pin
CPallini26-Nov-07 2:07
mveCPallini26-Nov-07 2:07 
GeneralRe: Image Skew(angle) Pin
Chris Losinger26-Nov-07 2:17
professionalChris Losinger26-Nov-07 2:17 
GeneralRe: Image Skew(angle) Pin
CPallini26-Nov-07 3:26
mveCPallini26-Nov-07 3:26 
GeneralRe: Image Skew(angle) Pin
Chris Losinger26-Nov-07 3:31
professionalChris Losinger26-Nov-07 3:31 
GeneralRe: Image Skew(angle) Pin
Luc3426-Aug-10 4:22
Luc3426-Aug-10 4:22 
AnswerRe: Image Skew(angle) Pin
Chris Losinger26-Nov-07 2:14
professionalChris Losinger26-Nov-07 2:14 
QuestionHow to convert initialize an unsigned char* Pin
prithaa25-Nov-07 23:45
prithaa25-Nov-07 23:45 

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.