NO

Author Topic: ATL example  (Read 9451 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
ATL example
« 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.
« Last Edit: June 28, 2013, 06:21:13 PM by timovjl »
May the source be with you

czerny

  • Guest
Re: ATL example
« Reply #1 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.
« Last Edit: June 29, 2013, 05:52:05 PM by czerny »

czerny

  • Guest
Re: ATL example
« Reply #2 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?


Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: ATL example
« Reply #3 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"
May the source be with you

czerny

  • Guest
Re: ATL example
« Reply #4 on: June 30, 2013, 08:23:23 PM »
Thanks!!

Offline bitcoin

  • Member
  • *
  • Posts: 179
Re: ATL example
« Reply #5 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)?

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: ATL example
« Reply #6 on: April 11, 2019, 07:53:44 AM »
That ATL control container choose that control.
Q192560
ATL Control Containment FAQ
May the source be with you

Offline bitcoin

  • Member
  • *
  • Posts: 179
Re: ATL example
« Reply #7 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.

Offline bitcoin

  • Member
  • *
  • Posts: 179
Re: ATL example
« Reply #8 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?

Offline bitcoin

  • Member
  • *
  • Posts: 179
Re: ATL example
« Reply #9 on: August 23, 2019, 02:20:42 AM »
Yes! I did it !!!
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).