Thanks, Ken. Much appreciated.
"Ken" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Mon, 12 Mar 2001 14:30:21 -0800, "Steve Williams"
> <[EMAIL PROTECTED]> wrote:
>
> >I've got this to work. Here's the procedure, if anyone's interested :-
> >
> >1. Create new MSDev Win32 application project.
> >
> >2. Add all the files source files from the winembed directory :-
> >winembed.cpp, stdafx.cpp, WebBrowserChrome.cpp, WindowCreator.cpp
> >
> >3. Add resource file, WinEmbed.rc
> >
> >4. Add an include path (under Tools->Options->Directories) for
> >mozilla\dist\include
>
> you will probably also need to add the nsprpub include paths,
> different for debug and release, so for example, for debug add
> mozilla\dist\win32_D.OBJ\include;mozilla\dist\include
>
> >
> >5. Add a library path (under Tools->Options->Directories) for
> >mozilla\dist\WIN32_D.OBJ\lib
> >(this will pick up debug libs, set appropriately for release libs if
> >required).
> >
> >6. Add the following preprocessor definition under
project->settings->C/C++
> >XP_WIN
>
> also add XP_PC
>
> >
> >7. Replace main(...) with WinMain equivalent in winembed.cpp
> >
>
> don't need to do that. main() works fine. Just make sure when you
> start the project to say it is a win32 *command line* application, not
> a win32 application.
>
> >8. Add the following code to winembed.cpp :-
> >
> >// BEGIN MSDEV .dsp patch
> >// Link to appropriate mozilla libraries ...
> >#pragma comment( lib, "baseembed_s.lib" )
> >#pragma comment( lib, "gkgfxwin.lib" )
> >#pragma comment( lib, "xpcom.lib" )
> >
>
> you can simply add these to the project settings, rather than adding
> pragmas to the source code. Saves you the trouble of having to add or
> merge this code again later.
>
> >// For some reason this destructor is undefined.
> >// Does someone have a better solution than this cut & paste hack ?
> >#include "nsCOMPtr.h"
> >nsCOMPtr_base::~nsCOMPtr_base()
> > {
> > if ( mRawPtr )
> > NSCAP_RELEASE(this, mRawPtr);
> > }
> >// END MSDEV .dsp patch
> >
>
> you need to define "DEBUG", for debug builds (the standard setting for
> a win32 project is "_DEBUG", but nsCOMPtr expects "DEBUG")
>
> >9. Set the working directory to the mozilla bin directory. If you don't
do
> >this then
> >winEmbed will be unable to find the DLLs or create the components it
needs
> >to
> >work properly.
> >
> >10. Compile & run. Skip over any asserts that might pop up.
> >
> >Wow, my first contribution to any open source project.
> >
> >- Steve.
> >
> >PS. If anyone has solution to avoid the hack mentioned in (8), it would
be
> >appreciated.
> >
>
> you can create a working project in msdev without changing a single
> line of the winembed source code. enjoy!
> Ken