views:

117

answers:

2

I have an ActiveX control which is designed to * Search for nearby wireless networks * Create a wireless access point * Manage network adapters

I would like this plugin to work in Google Chrome/Firefox. In IE; I can use the following code to embed:

<object classid="clsid:33FC4347-8118-4DB5-BFBE-8FCF2C96A997" width="32" height="32" id="thectrl"></object>

and I create a wireless network as follows (in JavaScript): thectrl.createNetwork("test",0,null,"NONE",3); The ActiveX has an IDL file, and outputs to OCX format. How do I turn this into a plugin for Google Chrome/Firefox?

A: 

Hi,

It would be best if you have the source code of the ActiveX and let the NPAPI headers expose the functionality you need. If you want to turn that into a plugin, you would definitely need C++ knowledge to create that NPAPI library.

So your only solution at this point is creating your NPAPI plugin. You might try some of the Mozilla examples at https://developer.mozilla.org/En/Plugins. If you are completely new to NPAPI though, maybe you'd want to start with https://developer.mozilla.org/en/Gecko_Plugin_API_Reference.

To start developing, all you need are the standard NPAPI headers, which you can now get from http://code.google.com/p/npapi-headers/source/browse/

An example plugin we use in Chromium: http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/plugins/test/

Mohamed Mansour
I would prefer a way to do it natively through C++. I have developed the plugin using C++, and do not desire to use any third-party tools to make it NP compatible (unless absolutely necessary). So how exactly do I create an NPAPI library in C++? I'm using Visual Studio 2010, and there doesn't seem to be any real thorough documentation on the process of creating a plugin. Do I expose attributes through an IDL file? Or how does the Netspace plugin system work? I'm looking for a generic implementation of the NPAPI which will work cross-browser for the most part.
IDWMaster
There are NPAPI headers that you need to download. The most updated ones that you can use are: http://code.google.com/p/npapi-headers/source/browse/ that are maintained by Google. I have updated my answer to help you out with some resources.
Mohamed Mansour
+1  A: 

If you want to rewrite it to support NPAPI, an easy way is to use the FireBreath framework. It gives you an abstraction over the plugin architectures, is cross-platform and allows you to support NPAPI and ActiveX from one source base.

But then again i am biased, so if you want to do it manually instead, here are some starting points:

Georg Fritzsche
Thanks! This is just what I needed!
IDWMaster