Escolar Documentos
Profissional Documentos
Cultura Documentos
This is Part I of a new series on creating IE plug-ins. In this article, I will show you how I
ported and debugged an existing project from Code Project. So let’s go! This is what final
product will look like.
I first tried using Visual C++ 2008 Express but to no avails because of missing libraries. I
finally had to download and install the 90-day trial version of Microsoft Visual Studio, which
I highly recommended. It’s very easy to use and it’s free!! Three months should be enough
time for you to get your feet wet (very wet) with developing Visual C++ programs.
I had to make the following changes to port this RssReaderPlugin, a Visual Studio 6.0
project, to a Visual Studio 2008 project. First, double click RssReaderPlugin.sln to start
Visual Studio 2008.
The Visual Studio Conversion Wizard would pop up. Click “Next”.
Keep the default setting (create a backup file) and click “Next” to continue.
Click “Finish”.
Then click “Close” to close the windows.
The IWebBrowser2 class is included in <Exdist.h>. Add the include statement to get rid of
all IWebBrowser2 related errors.
Build again. This time you will get another error :”error C2664:
‘ATL:CWindowImpl<T,TBase>::Create’ : cannot convert parameter 2 from ‘int’ to ‘RECT &’.
Double click to get to the violating line.
Another way you can register the DLL is by using the register.bat already in the Debug
directory.
Start a new Internet Explorer instance. The Rss Reader Toolbar already has been enabled.
To view the Rss Reader entry from the list of Internet Explorer Add-ons, click “Tools”-
>”Manager Add-ons”->”Enable or Disable Add-ons”.
Ouch! You would see a Debug Assertion Failed message. Don’t worry – we will take care of
it. Click “Retry”.
Make sure that RssReaderPlugin project is open and select it from the Possible Debuggers
list.
Click Break.
Go to the source panel. You should see a small Yellow Arrow, indicating the breakpoint. This
line tells us that uFormat contains DT_MODIFYSTRING option, which tells DrawText to
modify the specified string to match the displayed text. This value has no effect unless
DT_END_ELLIPSIS or DT_PATH_ELLIPSIS is specified. This option is only allowed for
Windows CE platform (_WIN32_WCE).
To find out where DT_MODIFYSTRING option is set (we need to unset it), use the Find and
Replace tool from Visual Studio (also available in the Express edition). Go to “Edit”->”Find
and Replace”.
Click the first find, which is on line 263 of RRPNewsButton.cpp and delete all
DT_MODIFYSTRING from the OR combo.
Click the second find, which is on line 347 of RRPNewsButton.cpp and delete all
DT_MODIFYSTRING from the OR combo.
To view the RSS feed from shallwelearn.com, click the RSS feed button.
You will be taken to the RSS page of shallwelearn.com, which is:
http://shallwelearn.com/index.php?format=feed&type=rss
To set the RSS page to shallwelearn’s RSS feed, click “Rss Reader” to open the
Configuration Settings Window.
Right now the code will always just shows the first one in the RSS item list, which is “Top
Stories”, so we copy and paste the ShallWeLearn RSS feed as the Link of the RSS of the Top
Stories. Click Save to save.
Now if you click Top Stories button, you should see the updated RSS feed.