Pelles C forum

C language => Tips & tricks => Topic started by: TimoVJL on June 28, 2013, 06:19:37 PM

Title: ATL example
Post by: TimoVJL on June 28, 2013, 06:19:37 PM
There was an ATL example, but it disappeared ?
It was so good, that i have try to do similar one.
Title: Re: ATL example
Post by: czerny on June 29, 2013, 05:48:24 PM
You can use "MSCAL.Calendar" or "MSHTML:<H1>Hello World</H1>" instead of "http://forum.pellesc.de" for example.
Title: Re: ATL example
Post by: czerny on June 30, 2013, 10:58:58 AM
Tried "OWC.Spreadsheet.9" and it works.

But now I need AtlAxGetControl()?

The ATL header files are in PSDK but they need C++.
Is there a way to make this work?

Title: Re: ATL example
Post by: TimoVJL on June 30, 2013, 11:04:45 AM
Code: [Select]
HRESULT __declspec(dllimport) WINAPI AtlAxGetControl(HWND hwnd, IUnknown** unk);atlx.def
Code: [Select]
LIBRARY ATL.DLL
EXPORTS
"_AtlGetVersion@4"
"_AtlAxWinInit@0"
"_AtlAxGetControl@8"
Title: Re: ATL example
Post by: czerny on June 30, 2013, 08:23:23 PM
Thanks!!
Title: Re: ATL example
Post by: bitcoin on April 10, 2019, 11:41:31 PM
I can not understand this source code.
How does C "know" that it is the browser object that needs to be called?
What else can be placed on the form (in the window)?
Title: Re: ATL example
Post by: TimoVJL on April 11, 2019, 07:53:44 AM
That ATL control container choose that control.
Q192560 (https://jeffpar.github.io/kbarchive/kb/192/Q192560/)
ATL Control Containment FAQ (https://docs.microsoft.com/en-us/cpp/atl/atl-control-containment-faq?view=vs-2019)
Title: Re: ATL example
Post by: bitcoin on August 22, 2019, 05:52:48 PM
TimoVJL, if I open some pages with ATL browser, I have javascript error. That annoying me from many messageboxes (script error, continue?)
Do you know, how to disable it? And why original Internet Explorer don't show this.
Title: Re: ATL example
Post by: bitcoin on August 23, 2019, 01:33:46 AM
I discovered, that need option Silent->true (in IWebBrowser2). But how to add it, if ATL hided all options?
Title: Re: ATL example
Post by: bitcoin on August 23, 2019, 02:20:42 AM
Yes! I did it !!! (https://s.tcdn.co/fb5/980/fb598033-cd8e-31ec-a28b-e35d1692ff08/192/5.png)
I take number of guid from https://www.magnumdb.com

Another code i take from Timo sources
Code: [Select]
DEFINE_GUID(IID_IWebBrowser2,0xd30c1661,0xcdaf,0x11d0,{0x8a,0x3e,0x00,0xc0,0x4f,0xc9,0xe2,0x6e});

HRESULT __declspec(dllimport) WINAPI AtlAxGetControl(HWND h,IUnknown** pp);

///skipped
case WM_CREATE:
hr = AtlAxWinInit();
hBrowser = CreateWindowEx(WS_EX_STATICEDGE, "AtlAxWin",
"https://yandex.ru",
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL
, 0, 0, 0, 0, hWnd,
(HMENU)IDC_BROWSER, GetModuleHandle(NULL), NULL);
AtlAxGetControl(hBrowser, &unkn);
unkn->lpVtbl->QueryInterface(unkn, &IID_IWebBrowser2, (void **)&pBrowser2);
pBrowser2->lpVtbl->put_Silent(pBrowser2,TRUE);

All works! Thanks Timo, thanks to you, I understood COM a little (can to copy-paste it).