Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CDHtmlDialog crashing bug: inside mshtml.dll

67 views
Skip to first unread message

James Addison

unread,
Jun 2, 2003, 2:58:36 PM6/2/03
to
Hi everyone, I would like to get your feedback (and fixes!) for a weird bug
I'm having with MFC's CDHtmlDialog class.

I'm using CDHtmlDialog in a VC++ application to show dynamic content: based
on user actions within the html (clicking a button or checkbox), I am
inserting (or removing) more html text into the dialog. I do this by
generating the new html into CString member variables, and then refreshing
the page using CDHtmlDialog::SetElementHtml().

If I were to guess the stats on this, i would say that it works 75% of the
time; the remaining 25% it crashes, inside mshtml.dll, on insertion/removal
of html.

Has anyone else experienced this behaviour? Or do most people use
CDHtmlDialog/MSHTML hosting for static content? I can't release a product
with this behaviour, obviously. Does anyone know a way to debug into
mshtml.dll at all?

Microsoft, if you're reading this, please provide input. Thanks.

--
James Addison
ACD Systems

Switch the 'd' and the 'c' in adcsystems.com to reply via email.

Leonhardt Wille

unread,
Jun 3, 2003, 7:06:09 PM6/3/03
to
Hi,
I know that I had this problems once... I think you have to check your
declaration of the message handler functions for the click events. they have
to be in the following form:
HRESULT CToolBoxDlg::OnApply(IHTMLElement* /*pElement*/)

The first time I used the CDHtmlDialog, I declared the handler functions as
void. My program always crashed with an exception in the MSHTML.DLL after
the function terminated,
so I looked in a MSDN sample and found the correct declaration (which is not
documented in the MSDN library).

I hope this helps you,

regards, Leonhardt

"James Addison" <jadd...@adcsystems.com> schrieb im Newsbeitrag
news:OzZC6jTK...@TK2MSFTNGP12.phx.gbl...

James Addison

unread,
Jun 3, 2003, 7:32:33 PM6/3/03
to
Leonhardt,

Thanks for the suggestion; however, this is the way in which I declare my
HTML Event handlers currently, and I still have crashes. It appears to
crash upon use of the function CDHtmlDialog::SetHtmlElement().

Suggestion, anyone? Microsoft Professionals, you can respond too! :)


Thanks,

--
James Addison
ACD Systems

Switch the 'd' and the 'c' in adcsystems.com to reply via email.


"Leonhardt Wille" <lwi...@p-labor.de> wrote in message
news:eQVG6SiK...@TK2MSFTNGP09.phx.gbl...

Leonhardt Wille

unread,
Jun 5, 2003, 10:36:26 AM6/5/03
to
Hello,
I have another suggestion for you... why don't you insert an HTML DIV element into your dialog's HTML... If you set the ID of the DIV to "content" or something like this, you can modify your DoDataExchange() like this to get and set the content of it:

void

CToolBoxDlg::DoDataExchange(CDataExchange* pDX)
{
CDHtmlDialog::
DoDataExchange(pDX);
DDX_DHtml_ElementInnerHtml(pDX,"content",m_csHtml);
}

I'm using this functionality for a month now, and I didn't have any problems yet....

I hope you can use this workaround for your problem,

regards, Leonhardt

 

 

"James Addison" <jadd...@adcsystems.com> schrieb im Newsbeitrag news:#F6GrhiK...@TK2MSFTNGP11.phx.gbl...
0 new messages