1. Using the ExternalInterface in flash and let it interact with browser directly. In this way, flash can invoke Javascript code directly and let its function been invoked from flash. Flash can just register the code it want to be invoked to the ExternalInterface.
2.Using Activex control. This way, C++ code can directly invoke the flash function through the ActiveX container. Check the demo given by actionscript_examples.
Some related concepts that I got clear today are as follows:
The file extension (and generic name) for OLE Custom control (the X must have been added because it looked cool to Microsoft Marketing types). OCX modules are independent program modules that can be accessed by other programs in a Windows environment. OCX controls replaced VBX controls written in Visual Basic. OCX, both as a marketing term and a technology, was replaced by ActiveX controls. ActiveX is backward compatible with OCX controls because ActiveX containers, such as Microsoft's Internet Explorer, can execute OCX components. OCX controls can be either 16-bit or 32-bit.
ActiveX
is Microsoft's specification for reusable software components. ActiveX is based on COM, the Component Object Model. The basic idea is to define exactly how software components interact and interoperate so developers can create components that work together using the definition. ActiveX components were originally called OLE Servers and ActiveX Servers and this renaming (actually for marketing rather than technical reasons) has created a lot of confusion about what they are. A lot of languages and applications support ActiveX in some way or another and Visual Basic supports it very strongly since it's one of the cornerstones of the Win32 environment.
Note: Dan Appleman, in his book on VB.NET, has this to say about ActiveX, "(Some) products come out of the marketing department. ... What was ActiveX? It was OLE2 -- with a new name."
Note 2: Although VB.NET is compatible with ActiveX components, they must be enclosed in "wrapper" code and they make VB.NET less efficient. In general, if you can move away from them with VB.NET, it's a good idea to do that.
OLE
OLE stands for Object Linking and Embedding. This is a technology that first came on the scene along with the first really successful version of Windows: Windows 3.1. (Which was released in April 1992. Yes, Virginia, they had computers that long ago.) The first trick that OLE made possible was the creation of what is called a "compound document" or a document that has content created by more than one application. For example, a Word document containing a genuine Excel spreadsheet (not a picture, but the actual thing). The data can be provided by either "linking" or "embedding" which accounts for the name. OLE has gradually been extended to servers and networks and has gained more and more capability.
is Component Object Model. Although often associated with Microsoft, COM is an open standard that specifies how components work together and interoperate. Microsoft used COM as the basis for ActiveX and OLE. The use of the COM API ensures that a software object can be launched within your application using a wide variety of programming languages including Visual Basic. Components save a programmer from having to re-write code. A component can be large or small and can perform any kind of processing, but it must be re-usable and it must conform to set standards to for interoperability.
No comments:
Post a Comment