Thread: [GD-Windows] Internet plugin
Brought to you by:
vexxed72
From: Diogo de A. <dio...@ne...> - 2008-06-05 11:37:57
|
Hi all! I'm trying to build an Internet Explorer plug-in that displays what in practice is a window to my game engine. I got this working using MFCs with relative ease, but when I static link the MFCs (so that the user of the plugin doesn't have to go fetch 10000 updates and installation packs), the plugin size climbs to 6 Mbs, which I think it's too big (we all know what a space hog MFCs are). So I decided to try to build an ActiveX control from scratch and implement what I needed from scratch (knowing ofc that it envolves a lot of work). I built and registered an ActiveX control, that (for test purposes, since documentation on this kind of approach seems to be limited to MFCs) implemented IUnknown and IDispatch. First problem I came to was that the registering of the control didn't make it appear on the "Insert Control" list on the Active X Control Test Container, where I was supposed to make my tests. I solved that one by copying (again, for test purposes) the registry keys generated by the MFC version of my plugin, changing what was needed to reference my new control. Then, the real problem started: when I use the Active X Control Test Container and insert my control, the OCX I built gets called, my COM object is created, it's interfaces are queried both for IUnknown and IDispatch, and then (weirdly enough), it gets released (reference count goes to zero). After that, the Active X Control Test Container crashes somewhere trying to dispatch some message to some window that's set to NULL. Honestly, I can think of a bazillion things that go wrong, but I really don't know where to start. documentation on this kind of "manual" ActiveX controls is almost non-existent (at least, I can't seem to find it anywhere). My first guess was that my dispatch interface was badly built, but the IDispatch members aren't even called before the object is released, so it shouldn't be that. The fact that the Control Test Container is trying to access a NULL window makes me guess that he's probably trying to access the window that my object should have binded itself with or something, but again, I can't find no information. Anyone has any ideas on this? Even a small sample of a working internet explorer plugin would help a lot! Thanks in advance Diogo de Andrade |
From: Stephen C. <ste...@la...> - 2008-06-05 11:48:03
|
> Anyone has any ideas on this? Hi, I have used ATL (the ActiveX Template Library, comes as part of the non-free visual studio versions) with some success; its a LOT lighter weight than MFC. My plugin dll is 180k; of course all it does is download and validate the rest of the system, so its fairly minimal, but still thats a good size. The (compressed) installer .cab is only 87k, which is even better. Cheers, Steve. |
From: Diogo de A. <dio...@ne...> - 2008-06-05 12:50:45
|
Hi Steve, I've already looked onto ATL, but I honestly couldn't find a place to start... I've built an ATL project (using the template), and while it compiled and everything, it apparently didn't become visible to the Control Test Container... :\ If you have any pointers on when to start (web resources, source code, books, etc), I'd appreciate it... Thanks for the help, Diogo -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Stephen Clibbery Sent: quinta-feira, 5 de Junho de 2008 12:48 To: Game Development for MS Windows Subject: Re: [GD-Windows] Internet plugin > Anyone has any ideas on this? Hi, I have used ATL (the ActiveX Template Library, comes as part of the non-free visual studio versions) with some success; its a LOT lighter weight than MFC. My plugin dll is 180k; of course all it does is download and validate the rest of the system, so its fairly minimal, but still thats a good size. The (compressed) installer .cab is only 87k, which is even better. Cheers, Steve. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Stephen C. <ste...@la...> - 2008-06-05 13:37:20
|
Diogo de Andrade wrote: > Hi Steve, > > I've already looked onto ATL, but I honestly couldn't find a place to > start... > I've built an ATL project (using the template), and while it compiled and > everything, it apparently didn't become visible to the Control Test > Container... :\ > If you have any pointers on when to start (web resources, source code, > books, etc), I'd appreciate it... > > Thanks for the help, > Diogo Hi Diogo, I don't recall having any problems with registering the control; doesnt VS register it for you automatically after building it? AFAIK, that ought to be enough to make it appear in the test container. It is also possible to register it manually using the regsvr32 exe. Maybe there was a problem with it which meant registration failed? It'd be worth looking for errors/debug-output etc when the registration takes place to check this. In terms of references, I just found stuff of the web; heres a few (probably random) links from when I was researching it: http://edndoc.esri.com/arcobjects/8.3/GettingStarted/ATL.htm http://www.codeguru.com/Cpp/COM-Tech/atl/tutorials/article.php/c17 http://www.codeguru.com/Cpp/COM-Tech/atl/atl/article.php/c73 http://support.microsoft.com/kb/q166480/ http://msdn.microsoft.com/en-us/library/727z646z.aspx http://msdn.microsoft.com/en-us/library/xt153e2k.aspx http://www.microsoft.com/msj/0299/atl3activex/atl3activex.aspx The trick seemed to be to get the wizard set up right to do most of the work for you, then tweak/extend as needed at the source code level afterwards. HTH, Steve |