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

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

7. Replace main(...) with WinMain equivalent in winembed.cpp

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" )

// 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

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.



Reply via email to