adding WebBrowser Control to child window 
Author Message
 adding WebBrowser Control to child window

I have managed to open up a window and would like to add the webbrowser
control to it.

I am trying to do this with AtlAxCreateControl.

The parameters I am passing it are,
AtlAxCreateControl(" http://www.*-*-*.com/ ", m_myWnd, NULL, NULL);

now i have to cast the url like this.
LPSTR s = " http://www.*-*-*.com/ ";
LPCOLESTR ss = reinterpret_cast<LPCOLESTR>(ss);

then i can say,
AtlAxCreateControl(ss, m_myWnd, NULL, NULL);

when i do this, I click a button on my app to open the window. the
window opens and then another window with the MSN Search Fail page is
opened up. I cannot figure out why this is. I have not found anything
in the documentation that can help me.

Any help is appreciated.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Tue, 18 Feb 2003 03:39:10 GMT  
 adding WebBrowser Control to child window
The cast won't help - you need a real LPOLESTR pointer (as same as LPWSTR
under Win32). Use:

AtlAxCreateControl(L"http://www.microsoft.com", m_myWnd, NULL, NULL);

instead.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> I have managed to open up a window and would like to add the webbrowser
> control to it.

> I am trying to do this with AtlAxCreateControl.

> The parameters I am passing it are,
> AtlAxCreateControl("http://www.microsoft.com", m_myWnd, NULL, NULL);

> now i have to cast the url like this.
> LPSTR s = "http://www.microsoft.com";
> LPCOLESTR ss = reinterpret_cast<LPCOLESTR>(ss);

> then i can say,
> AtlAxCreateControl(ss, m_myWnd, NULL, NULL);

> when i do this, I click a button on my app to open the window. the
> window opens and then another window with the MSN Search Fail page is
> opened up. I cannot figure out why this is. I have not found anything
> in the documentation that can help me.

> Any help is appreciated.

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Tue, 18 Feb 2003 10:58:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Newbie->How to add Tabbed control to child window

2. Newbie->How to add Tabbed control to child window

3. Adding WebBrowser control at runtime

4. Adding events to MS WebBrowser control generates errors ?

5. Main Window with dynamically-created child windows containing controls

6. Child window of ActiveX control doesn't draw when control is moved in dialog

7. TAB key, controls and child windows with controls

8. Getting a handle to a child window / Resizing a child window

9. Windows Exploring with the WebBrowser Control

10. Child Window in Child Window

11. Getting a handle to a child window / Resizing a child window

12. Please Help - Adding Controls to a form from a child thread

 

 
Powered by phpBB® Forum Software