NO

Author Topic: ATL example  (Read 2920 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1877
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: 1877
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: 76
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: 1877
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: 76
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: 76
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: 76
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).