The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Farabi on January 01, 2011, 11:57:31 AM

Title: Load a webpage
Post by: Farabi on January 01, 2011, 11:57:31 AM
How to load a webpage on our application? Especially flash?
Title: Re: Load a webpage
Post by: donkey on January 01, 2011, 06:34:55 PM
ATL will do that for you.
Title: Re: Load a webpage
Post by: dedndave on January 01, 2011, 07:46:57 PM
wow this is cool, Edgar - i can't get a CR/LF though - lol

EDIT - i couldn't get a TAB, either

now all we need is an atl.inc and atl.lib   :P
Title: Re: Load a webpage
Post by: donkey on January 01, 2011, 08:19:45 PM
Hi Dave,

I have to admit that I haven't really looked at that code for quite some time. I did the demo as a test piece when I was writing Help2 Viewer, mostly just to try out ideas without polluting the main projects code. There are better ways to load web pages than ATL but the development time for ATL is pretty short so I usually use it.

Jeremy did a demo here:

http://www.masm32.com/board/index.php?topic=7247.0
Title: Re: Load a webpage
Post by: Farabi on January 02, 2011, 04:46:39 AM
Quote from: donkey on January 01, 2011, 06:34:55 PM
ATL will do that for you.

Very cool edgar but it seems your exe is injected by sality virus, but maybe a false positive alarm.
Title: Re: Load a webpage
Post by: donkey on January 02, 2011, 07:52:54 AM
Its a false positive, your AV software is probably finding some signature in there that it doesn't like. Avira doesn't find anything...

QuoteStart of the scan: Sunday, January 02, 2011  00:51

Starting the file scan:

Begin scan in 'C:\Programming\RadASM\GoAsm\Projects\ATLDemo\ATLDemo.exe'


End of the scan: Sunday, January 02, 2011  00:51
Used time: 00:00 Minute(s)

The scan has been done completely.

      0 Scanned directories
      1 Files were scanned
      0 Viruses and/or unwanted programs were found
      0 Files were classified as suspicious
      0 files were deleted
      0 Viruses and unwanted programs were repaired
      0 Files were moved to quarantine
      0 Files were renamed
      0 Files cannot be scanned
      1 Files not concerned
      0 Archives were scanned
      0 Warnings
      0 Notes

Bet you're using AVG.
Title: Re: Load a webpage
Post by: Farabi on January 02, 2011, 09:18:35 AM
No I used smadav.
Anyway, where is the ATLAPI header and dll is? Is it included on XP?
Title: Re: Load a webpage
Post by: caseys on January 02, 2011, 10:28:44 AM
no viruses found =]

https://www.virustotal.com/file-scan/report.html?id=c8402df4e5358ddac9e2b2c18fceb9a7293bdc53c88f858e95e8c623f5e2234f-1293963916




File name: ATLDemo.exe
Submission date: 2011-01-02 10:25:16 (UTC)
Current status: finished
Result: 1/ 41 (2.4%)

Comodo 7270 2011.01.02 Heur.Packed.Unknown

Title: Re: Load a webpage
Post by: donkey on January 02, 2011, 04:06:46 PM
Quote from: Farabi on January 02, 2011, 09:18:35 AM
No I used smadav.
Anyway, where is the ATLAPI header and dll is? Is it included on XP?

The Active Template Library (http://msdn.microsoft.com/en-us/library/t9adwcde%28v=VS.80%29.aspx) (ATL) is shipped with Windows (atl.dll). The header is available with Visual studio if you're using C/C++ and with the GoAsm headers if you are using GoAsm. I am sure someone must have done one for MASM at some point so you should be able to find it or worst case make one yourself. You will also need the control (dispatch) header for any controls (such as exdisp.h for the webrowser) that you want to use in an ATL container, like the atl header they can be found in the Visual studio or GoAsm headers.
Title: Re: Load a webpage
Post by: Gunner on January 02, 2011, 04:44:07 PM
you don't have to use an inc file, you can LoadLibrary the atl dll...

I had this for a while... Played around with it... works.. take a look at it...
Title: Re: Load a webpage
Post by: Farabi on January 03, 2011, 06:52:38 AM
Quote from: Gunner on January 02, 2011, 04:44:07 PM
you don't have to use an inc file, you can LoadLibrary the atl dll...

I had this for a while... Played around with it... works.. take a look at it...

:U Thanks gunner.
Title: Re: Load a webpage
Post by: Magnum on January 03, 2011, 03:26:18 PM
Your "mini-browser" code is pretty neat.

Title: Re: Load a webpage
Post by: dedndave on January 03, 2011, 03:28:59 PM
i notice it has the same little issue as Edgar's
i can't get the Enter or Tab keys to work
i am sure it is because these are simple demo programs, not intended to be fully functional
Title: Re: Load a webpage
Post by: Magnum on January 03, 2011, 03:56:49 PM
We are confident that you can fix it.

Title: Re: Load a webpage
Post by: dedndave on January 03, 2011, 07:38:29 PM



<<<<<<<<<<<------------------- frigin clueless   :lol
Title: Re: Load a webpage
Post by: Gunner on January 03, 2011, 07:50:02 PM
after work I will see what i can do about keyboar input.....  i will learn ya :-)
Title: Re: Load a webpage
Post by: Farabi on January 04, 2011, 02:31:56 AM
Hi Gunner,
How to use the dll without any prebuilt dialog?
Title: Re: Load a webpage
Post by: Gunner on January 04, 2011, 03:31:12 AM
Quote from: Farabi on January 04, 2011, 02:31:56 AM
Hi Gunner,
How to use the dll without any prebuilt dialog?

It does not use a prebuilt dialog.  You have to createwindow with the window class "AtlAxWin" and in createwindow hWindParent == the handle to your window you want the "control" on
Title: Re: Load a webpage
Post by: Farabi on January 06, 2011, 02:37:51 AM
I got the control working but the OLE32 is giving syntax error, why is that?
Title: Re: Load a webpage
Post by: Gunner on January 06, 2011, 02:41:26 AM
Quote from: Farabi on January 06, 2011, 02:37:51 AM
I got the control working but the OLE32 is giving syntax error, why is that?

Um, because it sensed that a pigeon crashed into a mountain on P39-865 and died today :toothy No, seriously, post the code and the error number and we can help....
Title: Re: Load a webpage
Post by: Farabi on January 06, 2011, 02:52:57 AM
Quote from: Gunner on January 06, 2011, 02:41:26 AM
Quote from: Farabi on January 06, 2011, 02:37:51 AM
I got the control working but the OLE32 is giving syntax error, why is that?

Um, because it sensed that a pigeon crashed into a mountain on P39-865 and died today :toothy No, seriously, post the code and the error number and we can help....

Nevermind, I got it working, it was just me and my careless Thanks, great job :U
The tiniest browser I ever see.
Title: Re: Load a webpage
Post by: dedndave on January 06, 2011, 03:04:59 AM
be careful with it, Onan
not very secure, i would imagine   :bg
Title: Re: Load a webpage
Post by: donkey on January 06, 2011, 03:35:32 AM
Quote from: Farabi on January 06, 2011, 02:52:57 AM
Nevermind, I got it working, it was just me and my careless Thanks, great job :U
The tiniest browser I ever see.

Hi Onan,

Don't let the small executable fool you. I haven't looked at it (its MASM) but if it uses the ATL then it is just a container for implementing Internet Explorer, I would imagine that though the executable would be small the actual footprint would be quite large. For example my ATL demo is about 50K in size but has a memory footprint averaging around 13 MB.
Title: Re: Load a webpage
Post by: Farabi on January 06, 2011, 03:41:25 AM
Donkey:
Thanks, yeah I guess it load all of the IE component.


All:
My app cannot open a Flash Page, anyone know why?
Title: Re: Load a webpage
Post by: donkey on January 06, 2011, 03:55:47 AM
Quote from: Farabi on January 06, 2011, 03:41:25 AM
My app cannot open a Flash Page, anyone know why?

Could be the default security setting for IE, they are applied to the WebBrowser object. I have issues loading pages with ActiveX components (html help pages), keeps blocking the ActiveX control and I have to manually enable it. Frustrating as heck but I don't want to globally enable them, I have to find out how to do it with IWebBrowser2.
Title: Re: Load a webpage
Post by: Magnum on January 06, 2011, 04:04:00 AM
Quote from: donkey on January 06, 2011, 03:35:32 AM
Quote from: Farabi on January 06, 2011, 02:52:57 AM
Nevermind, I got it working, it was just me and my careless Thanks, great job :U
The tiniest browser I ever see.

Hi Onan,

Don't let the small executable fool you. I haven't looked at it (its MASM) but if it uses the ATL then it is just a container for implementing Internet Explorer, I would imagine that though the executable would be small the actual footprint would be quite large. For example my ATL demo is about 50K in size but has a memory footprint averaging around 13 MB.


donkey,

I am getting 8576K in Task Manager as Mem Usage.

Is that a comparable value as it's memory footprint?

Title: Re: Load a webpage
Post by: oex on January 06, 2011, 04:08:15 AM
Quote from: Magnum on January 06, 2011, 04:04:00 AM
I am getting 8576K in Task Manager as Mem Usage.

Is that a comparable value as it's memory footprint?

It very much depends what page you are accessing
Title: Re: Load a webpage
Post by: Magnum on January 06, 2011, 04:29:59 AM
At twitter.com

FF = 46000K

Browser = 23000K
Title: Re: Load a webpage
Post by: Farabi on January 06, 2011, 05:58:11 AM
Im stuck here, I want to load this page http://antihack1221.awardspace.com/exp/map.html
But there are error messages poping.
Title: Re: Load a webpage
Post by: dedndave on January 06, 2011, 06:22:07 AM
it's a java script
Title: Re: Load a webpage
Post by: dedndave on January 06, 2011, 06:30:22 AM
http://maps.google.com/maps?ie=UTF8&ll=-6.795535,107.20459&spn=3.206876,4.108887&z=8

toward the upper right corner, there is a link called Link   :P
click that - then Customize and preview embedded map - then grab the embed
Title: Re: Load a webpage
Post by: Farabi on January 06, 2011, 06:50:40 AM
Thanks dave, youre right, I should know that.
Title: Re: Load a webpage
Post by: dedndave on January 06, 2011, 06:56:14 AM
try this one.....

:P
Title: Re: Load a webpage
Post by: Farabi on January 06, 2011, 07:11:02 AM
Quote from: dedndave on January 06, 2011, 06:56:14 AM
try this one.....

:P

That was cool dave, thanks   :U
Title: Re: Load a webpage
Post by: japheth on January 06, 2011, 02:09:55 PM
Quote from: dedndave on January 03, 2011, 03:28:59 PM
i notice it has the same little issue as Edgar's
i can't get the Enter or Tab keys to work
i am sure it is because these are simple demo programs, not intended to be fully functional

I've put the dust off the old WebBrowser sample - it still works and AFAICS it has no Enter/Tab-problem, although the basic version is now 9 years old ( made by Xtreme ).

This sample is not based on ATL, it's plain COM, in Masm assembly. Enjoy!  :green

However, better don't navigate to "weird" sites, IMO the security concerns are VERY justified.

http://www.japheth.de/Download/Samples/IEContainerSample.zip
Title: Re: Load a webpage
Post by: Magnum on January 06, 2011, 02:30:34 PM
Thanks a lot.

Full screen too.

Title: Re: Load a webpage
Post by: dedndave on January 06, 2011, 05:16:00 PM
very cool, Andreas   :U
light and fast
Title: Re: Load a webpage
Post by: japheth on January 10, 2011, 12:15:19 PM
After solving an issue with keyboard tab navigation, I was able to add an address bar to the browser application demo.

Also, the mini-browser will accept a command line parameter now.

Finally, thanks to MichaelW for the "missing ICC_COOL_CLASSES init"-tip!

Here's the final version, Public Domain:

http://www.japheth.de/Download/Samples/IEContainerSample.zip

P.S.: I named the thing JIE.