Embedding Gecko with VC8 Express
 

This page is to demonstrate how to embed latest (2006-05-30) Gecko into your Windows applications. Probably all you need would be a machine with Windows XP.

Steps to use sample SDK

Please note that this section is something educational purposed. The goal is to get familiar with hacking Gecko-based application.

  1. Download sample SDK + its runtime files, and unzip them. You can try "test_me_first.bat", in order to grasp what's going on.
  2. Download and install VC8 Express and Windows Platform SDK, according with the instruction by Microsoft, if you don't have VC8 installed yet.
  3. Double click the solution file in Sample SDK folder, and enjoy hacking. In this stage, you need minimum knowledge around Windows programings, such as what  the code means by "HWND", "WinMain" and so on.
  4. Build it, move the exe file into the runtime directory, and launch it. 

 

Steps to create sample SDK

I'm afraid you don't want to set up another kit. And probably you actually don't have to follow steps of this section. However, this information may help you to understand the overview and may shoot some troubles. If you are planning to release a *product*, you should not use the above runtimes, because they're based on nightly builds.  Alternatively, a release version of XULRunner is a good choice.

  1. Build Firefox / Seamonkey / XULRunner.
  2. Launch VC8 and start a new "Win32 Application" project.
  3. Set path to /dist/sdk/include/ and /dist/sdk/lib/.
  4. Copy some cpp files from Mozilla source to your project, according to the sample.
  5. Copy some header files from /dist/include/**/ to your project, according to the sample.
  6. Set compiler option /Zc:wchar_t-
    • Otherwise, you can't call nsAString functions in static libraries, and the linker will complain about "unresolved external symbol" error.
  7. Start editing cpp and other files.

Appendix