|
|
|
|
#1 |
|
Junior Member
|
Plugin for controlling Internet Explorer
Hi,
I've created a plugin for controlling Internet Explorer. I haven't found anything like it yet. Or anyway, that has the ability to make toolbars visible in Internet Explorer. I know, it's a bit big (51K) but I couldn't get it to compile/link smaller Anyway, it does the following, not much, but it can easily be expanded upon: - Open an internet explorer instance - Surf to an URL - Make a toolbar visible (you need to know its CLSID) - Close the browser. source files included. Remco Lam |
|
|
|
|
|
#2 |
|
Join Date: Sep 2003
Posts: 27,873
|
can't look at your code at the moment but have a look at the source code for the plugin here which may be of use in showing how you can cut the dll size down
![]() the code has a similar feature to you're plugin i guess and when i put the code in it only added 1k to 1.5k to the plugin's size (was thinking of coding a similar plugin myself but don't need to now i guess )hope this is of some help -daz |
|
|
|
|
|
#3 |
|
Junior Member
|
I've downloaded and compiled that plugin and compared all the settings.
I could copy almost all settings and it still worked. All except the entrypoint, if I set that I get the following error: libcmt.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Besides, I think most of the filesize probably comes from the my inclusion of COM pointers... (comdef.h) But if anyone manages in creating a smaller dll, I'd be very interested
|
|
|
|
|
|
#4 |
|
Join Date: Sep 2003
Posts: 27,873
|
the reason for the size is because of 'libcmt.lib' which is the c run time (crt) library. had a look and you're using things like sprintf, memset and using the default 'new' and 'delete' operators.
in my code i redefine the 'new' and 'delete' operators to not use the crt and if you put in you're own memset function and to use wsprintf(..) then that should cut things down ![]() if you don't beat me to it i'll post a modified version for you -daz |
|
|
|
|
|
#5 | |
|
Major Dude
|
Quote:
And the other features: - Open the Internet Explorer: Using the function "Wait file execution registry based" and just renaming the part that says (like) ExecWait "$..." to Exec "$...". - Close the Internet Explorer: Have some functions in Archive for it. - Opening an URL: Executing (i.e.) http://www.test.com using "Wait file execution registry based" (see Open the Internet Explorer). (to get the function "Wait file execution registry based", see it in my signature) |
|
|
|
|
|
|
#6 | |
|
Junior Member
|
Quote:
And of course, you could use other functions to open IE and surf to an URL. But my point was this one can easily be extended for all sorts of functions. You can even receive IE events (although I don't know why you'd need that in an installer) Dr0: Much obliged if you'd post that updated version. I'm pretty goed at high level programming, but don't ask me about low level code optimizations... Although I'll certainly take a look at your code and play around with it. Always good to learn something new. Why, just this week I learned how to make an installer using NSIS ![]() Remco |
|
|
|
|
|
|
#7 | |
|
Join Date: Sep 2003
Posts: 27,873
|
here's what i've done (only 4.5k now
) i have stripped some bits from the project (exdll dependancies which weren't needed) and a few other bits.the link error was to do with the crt being included i've altered the Navigate and Toolbar functions (the Navigate definitely works but you'll need to check the toolbar one out)for interest it is related to the _bstr_t (taken from an msdn example) Quote:
)-daz |
|
|
|
|
|
|
#8 | |
|
Junior Member
|
Quote:
Unforunately, showbar doesn't work anymore... Which is really weird, since I've stepped through the execution and the BSTR variant looks exactly the same whether I fill it using your functions or whether I use _bstr_t as a cast. (I put it back in just to test) ![]() Remco |
|
|
|
|
|
|
#9 |
|
Junior Member
|
Just relalized something. I think the problem is with bstr ownership.
When I do this: vtBandGUID1.bstrVal = _bstr_t(szBarCLSID); the _bstr_t class knows its being assigned to another BSTR and so relinguishes control over the BSTR (Or allocates a new BSTR) When I do: vtBandGUID2.bstrVal = bBarCLSID; Nothing special is done and the call of ShowBandObject doesn't have access to the bstr that is being passed on. VariantClear() afterwards isn't even necessary... Or am I completely off track here... I have to admit, I've been bluffing my way through COM without really understanding it :P Remco |
|
|
|
|
|
#10 |
|
Junior Member
|
Well, I was right, I've solved it.
I just needed to add SysAllocString So the call now is: vURL.bstrVal = SysAllocString(bstrUrl); Thanx for the downsizing help daz! Give me sec and I'll upload a new working version |
|
|
|
|
|
#11 |
|
Junior Member
|
Well, here it is. The dll is now 4.5K
Actually the bug is pretty obvious, once you see it ![]() Again, thanks daz Remco |
|
|
|
|
|
#12 |
|
Join Date: Sep 2003
Posts: 27,873
|
just seen this has changed.
it was no problem plus a 4.5k is a lot nicer -daz [edit] just checked out the new version and i see you haven't updated the text file -> still refers to a 56k file size. pointing it out in case you haven't noticed it already ![]() [/edit] Last edited by DrO; 31st October 2003 at 15:52. |
|
|
|
|
|
#13 | |
|
Junior Member
|
Quote:
![]() <edit> Well, I'll upload it again, I've made some changes anyway >/edit> Remco Last edited by dRaakje; 3rd November 2003 at 09:42. |
|
|
|
|
|
|
#14 |
|
Junior Member
|
Here's a new version. The attached zip contains the 2 dll's, one real small one (3.5K) that works just fine. And a slightly bigger one (5.1K) that displays some messageboxes when an error occurs.
Of course I've also updated the included text file. Greets Remco |
|
|
|
|
|
#15 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
No Archive page?
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#16 | |
|
Junior Member
|
Quote:
![]() Remco |
|
|
|
|
|
|
#17 |
|
Join Date: Sep 2003
Posts: 27,873
|
archive is here
you will need to register as a user for the archive (is up at the top of the page to do that). once your registered then go down to 'contribute' (or similar worded) and follow the instructions. as a note you should probably link to the most current version you have in this thread on the page you create. -daz |
|
|
|
|
|
#18 | |
|
Junior Member
|
Quote:
![]() I'll make a page right away... <EDIT> It is done! </EDIT> Remco |
|
|
|
|
|
|
#19 |
|
Junior Member
Join Date: Jun 2008
Posts: 7
|
I downloaded the plugin and put it in:
C:\Program Files\NSIS\Plugins And then I tried compiling this: outFile "installer.exe" section IEFunctions::OpenBrowser /NOUNLOAD sectionEnd only to get this error: Invalid command: IEFunctions::OpenBrowser Error in script "C:\Documents and Settings\jnowacki\Desktop\NSIS\link.nsi" on line 7 -- aborting creation process Suggestions? |
|
|
|
|
|
#20 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Make sure you put IEFunctions.dll not IEFunctionsDbg.dll in there. Also what are you doing exactly? If you want to just open a web page, just use ExecShell open `http://...`
Stu |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|