| | |
Gecko SDK Mozilla Plugin Development - Why can´t use it on DEV C++???
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2008
Posts: 1
Reputation:
Solved Threads: 0
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...
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...
I don't know the answer but may be these links help you:
http://www.nabble.com/Linking-errors...td1356421.html
http://www.geocities.com/yongweiwu/stdcall.htm
It seems you need Gecko gcc build...
http://www.nabble.com/Linking-errors...td1356421.html
http://www.geocities.com/yongweiwu/stdcall.htm
It seems you need Gecko gcc build...
![]() |
Other Threads in the C++ Forum
- Previous Thread: creat file for data in output folder
- Next Thread: Question on vector(STL's)
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph homeworkhelp iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg simple sorting spoonfeeding string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






