Click here to Skip to main content
16,011,120 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralMenu Ownerdraw and WindowFromDC Pin
Derick Cyril Thomas6-Jun-04 2:28
Derick Cyril Thomas6-Jun-04 2:28 
GeneralRe: Menu Ownerdraw and WindowFromDC Pin
Jason De Arte6-Jun-04 14:14
Jason De Arte6-Jun-04 14:14 
GeneralRe: Menu Ownerdraw and WindowFromDC Pin
Derick Cyril Thomas6-Jun-04 16:50
Derick Cyril Thomas6-Jun-04 16:50 
Questionhow to use WTL in other IDE,e.g bc++? Pin
lzh085-Jun-04 22:51
lzh085-Jun-04 22:51 
GeneralActiveXcontrol with directX in clientwindow , how prevent drawing background color Pin
Vliegenthart5-Jun-04 0:40
Vliegenthart5-Jun-04 0:40 
GeneralATL experts, help! Navigating to a new page in an ATL Active X control Pin
mcase4-Jun-04 22:44
mcase4-Jun-04 22:44 
GeneralRe: ATL experts, help! Navigating to a new page in an ATL Active X control Pin
Jason De Arte6-Jun-04 7:28
Jason De Arte6-Jun-04 7:28 
GeneralGreat advice! Pin
mcase6-Jun-04 22:45
mcase6-Jun-04 22:45 
Thanks Jason!

I only had to make a few changes to get your code working in my app.

I didn't need to pass the "IOleObject* pObject" object, since this code was in the same class as the main ATL ActiveX control. Aside from that, I just had to add the template definitions for the ATL classes used (IOleClientSite,IServiceProvider,IWebBrowser2). Also, "m_sLandingPage" is a global char* to the URL to navigate to. I think this code should work in almost any ATL ActiveX control.

And no, unfortunately, we weren't able to figure out a way to get ActiveX controls to work in Netscape, after much effort. The conclusion we came to was that it would require so much of Java wrapper that it was impractical.

<br />
bool Ccompctrl::LaunchURL()<br />
{<br />
	CComPtr<IOleClientSite> spClientSite;<br />
	CComPtr<IServiceProvider> spSrvProv;<br />
	CComPtr<IWebBrowser2> spWebBrowser;<br />
<br />
	HRESULT hr = GetClientSite((IOleClientSite **)&spClientSite);<br />
	if( FAILED(hr) )<br />
		return false;<br />
<br />
	hr = spClientSite->QueryInterface(IID_IServiceProvider, (void **)&spSrvProv);<br />
	if( FAILED(hr) )<br />
		return false;<br />
<br />
	hr = spSrvProv->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, (void **)&spWebBrowser);<br />
	if( FAILED(hr) )<br />
		return false;<br />
<br />
	CComVariant vNull;<br />
	CComBSTR bsLandingPage = m_sLandingPage;<br />
	hr = spWebBrowser->Navigate(bsLandingPage, &vNull, &vNull, &vNull, &vNull);<br />
	if( FAILED(hr) )<br />
		return false;<br />
<br />
	return true;<br />
}<br />

GeneralTo clarify Pin
mcase6-Jun-04 22:50
mcase6-Jun-04 22:50 
GeneralRe: To clarify Pin
Jason De Arte7-Jun-04 8:24
Jason De Arte7-Jun-04 8:24 
GeneralProblem using CResizableFormView with MSFLEXGRID control! Pin
Nguyễn Thiện Nhẫn4-Jun-04 18:33
Nguyễn Thiện Nhẫn4-Jun-04 18:33 
Generalquery reg STL maps Pin
Member 11501763-Jun-04 23:32
Member 11501763-Jun-04 23:32 
GeneralRe: query reg STL maps Pin
Paul Ranson4-Jun-04 3:02
Paul Ranson4-Jun-04 3:02 
GeneralRe: query reg STL maps Pin
Member 11501764-Jun-04 3:19
Member 11501764-Jun-04 3:19 
GeneralRe: query reg STL maps Pin
sas22224-Jun-04 4:47
sas22224-Jun-04 4:47 
GeneralRe: query reg STL maps Pin
sas22224-Jun-04 5:26
sas22224-Jun-04 5:26 
GeneralRe: query reg STL maps Pin
sas22224-Jun-04 5:32
sas22224-Jun-04 5:32 
GeneralRe: query reg STL maps Pin
Paul Ranson4-Jun-04 5:38
Paul Ranson4-Jun-04 5:38 
QuestionAnybody tell me how to use IStream correctly? Pin
max_xiayi3-Jun-04 18:59
max_xiayi3-Jun-04 18:59 
AnswerRe: Anybody tell me how to use IStream correctly? Pin
Todd Smith4-Jun-04 13:22
Todd Smith4-Jun-04 13:22 
AnswerRe: Anybody tell me how to use IStream correctly? Pin
f649-Jun-04 6:31
f649-Jun-04 6:31 
GeneralBase Class Undefined Pin
TFrancis3-Jun-04 7:56
TFrancis3-Jun-04 7:56 
QuestionHow to call methods of an appobject directly? Pin
Roozbeh692-Jun-04 4:01
professionalRoozbeh692-Jun-04 4:01 
QuestionWhat a sh##t!!! Pin
El'Cachubrey2-Jun-04 2:25
El'Cachubrey2-Jun-04 2:25 
AnswerRe: What a sh##t!!! Pin
sas22222-Jun-04 3:55
sas22222-Jun-04 3:55 

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.