 |
|
|
 |
|
 |
Hello,
in your sample you have
<img src=\"rang.png\" ...>
How can i show a image without put it
to the exe resource ?
because i have the image in the memory
Thanks
JimmyO
|
|
|
|
 |
|
 |
Hi,
I just want to know whethere there is any event handler for the changes in the webbrowser. I mean if there is any change in the webbrowser i must know the change. Hope u got it. If u suggest me a solution I would be very happy.
my id is gangadhar.bonda @valuelabs.net
Thanks and regards,
Bonda V N S Gangadhar .
|
|
|
|
 |
|
 |
If you mean how to know if the user has clicked on a link you can use OnAppCmd(LPCSTR lpszWhere), if you are speaking on how to detect changes in the HTML, then you should use functions that are from the API directly, exactly in the same way you would do it if you were using a CHTMLView class.
Hope this helps...
|
|
|
|
 |
|
 |
void CHTMLCtrl::OnDestroy()
{
IHTMLDocument2Ptr pHTMLDoc2 = NULL;
pHTMLDoc2 = this->GetHtmlDocument();
if (pHTMLDoc2)
{
pHTMLDoc2->Release();
}
// This is probably unecessary since ~CHtmlView does it, but
// safer to mimic CHtmlView::OnDestroy.
/*
if (m_pBrowserApp)
{
m_pBrowserApp->Release();
m_pBrowserApp = NULL;
*/
}
CWnd::OnDestroy(); // bypass CView doc/frame stuff
}
Method Release not available now for ::ATL::CComPtr
|
|
|
|
 |
|
 |
I was getting an access violation when calling SetNewHTMLContent. The violation occured in the IHTMLDocument2 write in SetHTMLInDocument. After much head scratching I determined that it was caused by calling SetNewHTMLContent from a worker thread instead of the UI thread. When I posted a message to the UI thread to set the new HTML everything worked.
|
|
|
|
 |
|
 |
Hello,
I've tried to use the Navigate() function to navigate to a URL, and for some reason it goes right back to the about:blank page. The URL I supply for the Navigate() starts loading, and when it's done loading it just goes right to the about:blank.
Is this a known issue? If so, how do I make it not do this?
Thanks.
|
|
|
|
 |
|
 |
I've got the same problem.
A workaround is this :
void CHTMLCtrl::OnDocumentComplete(LPCTSTR lpszURL)
{
CHtmlView::OnDocumentComplete(lpszURL);
m_bHTMLDocumentLoadedOK = true;
// set's me back to about:blank: this->SetHTMLInDocument();
}
Find that code and comment out that SETHTMLINDOCUMENT().
In my case its work's fine.
|
|
|
|
 |
|
 |
Hi,
I'm working with your HTMLCtrl and it's an absolutely great help.
I just noticed a thrown exeption at SafeArrayDestroy() in CHTMLCtrl::SetHTMLInDocument().
It occured randomly until I declared the member bstrVal and vt of the variant variable (pElement) to be NULL/VT_EMPTY.
best regards
Thomas
Here follows the code:
/*********************************************************************/
/ HTMLCtrl.cpp /
/*********************************************************************/
...
inline void TESTHR( HRESULT _hr ) { if FAILED(_hr) _com_issue_error(_hr); }
...
bool CHTMLCtrl::SetHTMLInDocument()
{
SAFEARRAY *pSafeArray = NULL;
VARIANT *pElement = NULL;
IHTMLDocument2Ptr pHTMLDoc2 = NULL;
LPDISPATCH lpDispatch = NULL;
HRESULT hr;
bool bReturn = false;
try
{
// Processat del document HTML, assignació de punters
// i escriptura del contingut de la cadena de text.
lpDispatch = this->GetHtmlDocument();
if (lpDispatch != NULL)
{
hr = lpDispatch->QueryInterface(IID_IHTMLDocument2, (LPVOID*)&pHTMLDoc2);
if (!SUCCEEDED(hr))
{
bReturn = false;
}
else
{
pSafeArray = ::SafeArrayCreateVector(VT_VARIANT, 0, 1);
if (pSafeArray)
{
hr = ::SafeArrayAccessData(pSafeArray,(LPVOID*) &pElement);
if (!SUCCEEDED(hr))
{
bReturn = false;
}
else
{
pElement->vt = VT_BSTR;
pElement->bstrVal = this->m_csHTMLContent.AllocSysString();
hr = ::SafeArrayUnaccessData(pSafeArray);
if (!SUCCEEDED(hr))
bReturn = false;
else
{
pHTMLDoc2->clear();
pHTMLDoc2->close();
hr = pHTMLDoc2->write(pSafeArray);
if (!SUCCEEDED(hr))
bReturn = false;
}
SysFreeString(pElement->bstrVal);
pElement->vt = VT_EMPTY;
pElement->bstrVal = NULL;
}
if (pSafeArray)
TESTHR(SafeArrayDestroy(pSafeArray));
}
if (pHTMLDoc2)
{
pHTMLDoc2->close();
pHTMLDoc2.Release();
}
}
lpDispatch->Release();
}
} catch (_com_error &e) {
TRACE("Error:\n");
TRACE1("Code = %08lx\n", e.Error());
TRACE1("Code meaning = %s\n", (char*) e.ErrorMessage());
TRACE1("Source = %s\n", (char*) e.Source());
TRACE1("Description = %s\n", (char*) e.Description());
}
return bReturn;
}
-- modified at 8:30 Wednesday 4th January, 2006
|
|
|
|
 |
|
|
 |
|
 |
Hello I used your HTMLCtrl in a resizable dialog and I got numerous warnings as they are shoved below. Whats happend?
First-chance exception in Sample.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
First-chance exception in Sample.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
First-chance exception in Sample.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
First-chance exception in Sample.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
|
|
|
|
 |
|
 |
I'm trying to use this control in my application to show the content of different folders in the local hard drive. One feature that I want to reach is to avoid the execution of an external application when the user clicks over a file. I mean, I want to avoid that the default editor is opened when the user double clicks or press return over a text file.
Is there anyway to capture these messages ??
Thanks in advance,
Marc Soleda
PD: Congrats!!
|
|
|
|
 |
|
 |
OS: Win2k. HTML page with animation (.AVI) as local file. The application can both navigate the file or load it from string. In both cases the animation is displayed on an older PC and is not displayd in a more recent one. Don't understand if it depends on HW or IE installation. Introduced some Sleep(). It doesn't correct the behaviour.
Unrelated Note: in the SetHTMLInDocument() function I've found the line pHTMLDoc2.Release(). This should be pHTMLDoc2->Release(), isn't it ?
regards
NDG
|
|
|
|
 |
|
 |
It seems that the problem it's on the mediaplayer side.
we've found that in some PC's the mediaplayer get's installed in a different way:
I'm working with an IBM laptop and it works like charm.
One of my co-workers has been trying to use it in a HP machine and some problems happened.
we are modifying the way we are injecting HTML inside the control so I hope to release a new version in 6 months more or less... (I'm completely buried on work).
I believe that the problems related to the avi files is solved if you uncheck this checkbox:
MEDIAPLAYER->TOOLS->OPTIONS->PERFORMANCE->ADVANCED->VIDEO ACCELERATION->Overlay (this should be the first checkbox in spanish "superposiciones").
Hope this helps.
|
|
|
|
 |
|
 |
OS: Win2k. HTML page with animation (.AVI) as local file. The application can both navigate the file or load it from string. In both cases the animation is displayed on an older PC and is not displayd in a more recent one. Don't understand if it depends on HW or IE installation. Introduced some Sleep(). It doesn't correct the behaviour.
Unrelated Note: in the SetHTMLInDocument() function I've found the line pHTMLDoc2.Release(). This should be pHTMLDoc2->Release(), ins't it ?
regards
NDG
|
|
|
|
 |
|
 |
I used this HTMLCTRL class in one of my program. it works fine for me even now. When I tested, I used following code fregment: CString str2, str = "<html><head></head><body><table>"; for ( int i=1; i<=6000; i++ ){ str += "<tr>"; for ( int j=1; j<=6; j++ ){ str2.Format("%d %d", i, j); str += "<td>" + str2 + "</td>"; } str += "</tr>"; } str += "</table></body></html>"; UpdateHTMLContent(str); It crashed!. Why??? Only today I found out: Change: pHTMLDoc2->clear(); pHTMLDoc2->close(); hr = pHTMLDoc2->write(pSafeArray); to: hr = pHtmlDoc2->open( CComBSTR("text/html"), CComVariant(CComBSTR("_self")), CComVariant(CComBSTR("")), CComVariant((bool)1), &lpdRet); hr = pHtmlDoc2->write(psa); hr = pHtmlDoc2->close(); lpdRet->Release(); it works now. Sure you need define these variables. You know that if you are reading this article. --- Herbert Yu Are you sure the speed of computer industry is proper? Are you sure the software you released is a bug free one?
|
|
|
|
 |
|
 |
Thank you.
We aknowledged this problem some weeks ago, so we have solved it also.
I should have readen this before and we could avoided some work.
Now, we are focusing our way to insert HTML in another way, and we don't need to regenerate all the web page for each modification.
Once again, thank you for your feedback.
|
|
|
|
 |
|
 |
> We aknowledged this problem some weeks ago, so we have solved
> it also.
Could you post your solution here, or send me an email to me at yuhaian(at)hotmail.com with [HTMLCTRL] somewhere in subject line? (Too many spam emails)
> I should have readen this before and we could avoided some work.
That's importance of communication
> Now, we are focusing our way to insert HTML in another way, and
> we don't need to regenerate all the web page for each
> modification.
Could you give me a little more information on "another way"? Using COM?
> Once again, thank you for your feedback.
Always welcome.
---
Herbert Yu
Are you sure the speed of computer industry is proper? Are you sure the software you released is a bug free one?
|
|
|
|
 |
|
 |
Thanks for the good article.
Actually, I used CHtmlView to get my Web Browser to load my page instead of a dialog.
I want to catch the event that user double-click onto my page or scrolling down, or intervene to see the text user select and drag out from my page.
But I could not know how to do it.
If you can advice some tips then it would be really appreciated
Thanks
Hung
|
|
|
|
 |
|
 |
Why this error im visual C++ .Net
syntax error : 'ATL::CComPtr' should be preceded by ':'
public
CComPtr m_pBrowserApp;
Visual C++ MFC, ATL, php
|
|
|
|
 |
|
|
 |
|
 |
1. Please tell me and give source code
i want to customize the browser ctl, so that
i can prevent (images,video clips, Activex ctl etc component) download,in MSDN it is given that it can be done by implementing the Ambient property , but complete detail i not get
2. i am using VC++ 6.0 , and (MSDN and In this VC Libraries) i not found the and please tell link from where i download the SDK which contain this , i want that the our DNS server address programetically using GetNetworkParams
Thanks,
charanjetreport_gi@rediffmail.com
ekodeveloper@yahoo.com
|
|
|
|
 |
|
 |
I'm completely absorbed by my work and very busy, but of course I want to try to help you.
I suppose that as me you are not a native english speaker so I'll rewrite the questions again in order to know if I've understood them well:
1. you want to avoid videoclips and other similar stuff to appear in your control, you've searched the MSDN and you think that the Ambient property will do it, but you don't know how to do it.
2. You use VC++6, and you want to use GetNetworkParams in order to get your DNS server address programatically?
well, tell me if this is true, then I'll try to help you.
Hope you to understand, I'm not a native english speaker.
|
|
|
|
 |
|
 |
Thanks for response,
The question are refined now:-
1.As you know IE or Any browser use HTTP Connection they first download the main page and then links in them , our Internet connection is slow and i want to be be it fast browser so i want that HTML page text content is dowloaded and rendered and stop at that moment as gif's or Jpeg files eat the time to download , i am using IE ctrl in my application to atomate for some purpose, i tried to stop in OnNavigateComplete2WebBrowser but it not work , i found article in MSDN in (Reusing the WebBrowser Control) and found the following section i copied from MSDN
(Download Control:-
Hosts can control certain aspects of downloading, such as frames, images, Java, and so on, by implementing an ambient property defined as DISPID_AMBIENT_DLCTL. When the host'sIDispatch::Invoke method is called with dispidMember set to DISPID_AMBIENT_DLCTL, it should place zero or a combination of the following values in pvarResult...)
2.i am writing direct mailer, so it need MX record finding , that is done if you have you DNS Server address known , i hear that GetNetworkParam works but in online MSDN it is given to include "iphlpapi.h" and this and "iphlpapi.lib" but these i not find in our VC++ 6.0 Enterprise edition library.
3.How to scroll data in CScrolView window greater than 32k lines , i tried by bypassing the Scrollmsgs using hooks,it works but not smoothly , as VC++ binary editor|RichEdit scroll > 32k
i Hope,you have better understanding about my questions now
|
|
|
|
 |
|
 |
Links like this work:
a href='http://www.microsoft.com'>Go to Microsoft
However, when I try a local link like this
a href='index.html'>test
I just get a clean page that says blankindex.html.
I also noticed that when you hover over the test hyperlink the destination says about:blankindex.html.
If I change the link to a href='file://index.html'>test it simply goes to a completely blank page.
Any thoughts?
|
|
|
|
 |