I want to develop some plugins for Mozilla Firefox and Internet Explorer. I download de Gecko SDK from mozilla.org, but all mozilla SDK development is by default focused on Visual Studio. And i don´t have Visual Studio. So then i adapted my own version of Gecko for Dev C++ ( GCC/G++ based ) and i made some tests creating some DLLs with it. Gecko compiles well on Dev C++, and i even copied the resource.rc file from the original gecko example ( basic.rc ) to "identify" my DLL properly. The DLL is loaded ( recognized ) by Firefox, but then firefox crash down and give me a message error...

The exactly same code compiled on Visual Studio 2005 ( here in the office i work ) works fine, compiles, and is properly loaded by Firefox with no errors.

One of the problems i found was that GCC/G++ doesn´t export methods very well with __stdcall when the project is an DLL. When i use extern "C" __lalala(dllexport), the functions is exported fine. But Mozilla doesn´t "understand" this interface, find the functions but when calls them, it crashes.

Here one example of exported function that Mozilla expects to find inside a DLL

NPError __stdcall NP_Initialize(NPNetscapeFuncs* aNPNFuncs)
{ ... }

and here what i have to made on Dev C++, for that functions are properly exported:

extern "C" __declspec(dllexport) NPError NP_Initialize(NPNetscapeFuncs* aNPNFuncs)
{ ... }

I don´t know what happens, i don´t know if there is to much siginificant diferences on a compile result from Visual Studio and GCC... But the same code, compiled in Visual Studio with the original __stdcall, and the GCC code with extern "C" __declspec(dllexport), only the visual studio one works.

Is this a constant, i mean, i can only develop a plugin for Mozilla if i use Visual Studio?? Its not possible to develop the same plugin on other compilers, like G++ ( dev C++ ) or Borland C++ Builder???

Just to const here, im testing on Mozilla Firefox 3.0...

Any help will be nice!!

Thanks a lot! And sorry any english mistakes...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.