Buy Cheap Software - Discount Software Delphi FAQ - Le Minh Duc
Delphi FAQ
Doing game projects bring me to Delphi, quite a friendly language. Here are some of the stuffs I learnt when using Delphi:


Incompatible types: 'TPersistantClass' and 'TWndClassA'

Thursday, 25 October 2007
I want to call the Windows RegisterClass() function, but I get the error "Incompatible types: 'TPersistantClass' and 'TWndClassA'" when compiling. How can I get around this?

The RegisterClass() function is declared both in the Classes unit and the Windows unit. To call the Windows version, simply prefix the call with the unit name.

Example:

procedure TForm .Button Click(Sender: TObject);

wc : TWndClass;

begin

Windows.RegisterClass(wc)

end;

60,00% of 5 voters found this FAQ useful,  I found this FAQ  useful useful  not useful not useful


Using ActiveX controls

Friday, 26 October 2007

In Director, movies that you intend to publish only as projectors for Windows, you can embed ActiveX (formerly known as OLE/OCX controls) controls that let you take advantage of the technology and adapt ActiveX controls to make them function as sprites in Director. You can use ActiveX controls to manage application resources for the hosted ActiveX control--for instance, to manage properties, events, and windows and filing properties. You can also manage resources used by the ActiveX control within the Director movie. ActiveX controls are not allowed in Shockwave.

The range of uses for ActiveX in Director is as limitless as the variety of ActiveX controls available. Using the Microsoft Web Browser control (installed with Microsoft Internet Explorer 3.0 or later), you can browse the Internet from within a multimedia production; using the FarPoint Spreadsheet control, you can create and access spreadsheets; using the InterVista VRML control, you can explore virtual worlds; using the MicroHelp extensive library of Windows widget controls, you can build and simulate complete Windows applications.

Note: Not all ActiveX controls expose their methods and properties in all hosts. Test the controls you want to use to see how they work in Director. Because ActiveX controls are non-Macromedia software, Macromedia Technical Support does not support them.

0% of 0 voters found this FAQ useful,  I found this FAQ  useful useful  not useful not useful


What is an ActiveX Control?

Friday, 26 October 2007

ActiveX emerged from the Microsoft technology OLE (Object Linking and Embedding). What that means effectively is the ability of one application to "host" another. For instance, if you put an equation in a Word document, you use Microsoft's Equation Editor. This is an application which sits inside Word almost. If ever you want to edit an equation, that application comes up again. This is because, by creating an equation, you have thereby inserted an OLE object into the document. Similarly if you use any of the other add-ons of Microsoft Office such as Organization Chart, or Microsoft Graph you are also creating OLE objects. But it does not apply only to add-ons. Even very large applications like Macromedia's Director become clients for Word: you can insert thereby a Movie into a document.

What ActiveX is, is a slimming down and rationalisation of OLE, as well as a method of transferring such OLE objects over the Internet. This is where the fun starts though. It was taken for granted that an OLE object could interact with the hard disk on your machine. And why shouldn't it? If you were going to have big pictures, or movies inside your word document is seems reasonable to think that they might be stored somewhere, and that the application doing the storing might be allowed to access the hard disk. However, this was done with pretty reputable stuff. The OLE applications on our hard disk got there because we specifically unwrapped software, installed them from CD, did a bit of initialisation tweaking and then watched them work. But the notion of these very powerful entities coming over the Internet, installing themselves into the very being of your machine, initialising themselves among your registries and God knows what else, did begin to make some people panic a bit. And quite rightly given some of the scares going round at the beginning of 1997.

For instance on German TV on January 28 1997 in a demonstration, members of a group called the Chaos Computer Club showed how an ActiveX program could take control of a PC and transfer funds from a bank account on Intuit's Quicken financial network without the user's knowledge. Given the hype and hopes for on-line trading this was pretty grim news - and obviously the Germans had exploited the financial element for maximum effect. Microsoft soon responded by saying that their technology known as Authenticode could prevent such malicious or ActiveX controls from being downloaded, since a) they would identify the author of any ActiveX control (or Plug-In or applet for that matter) as well as b) determining that the component hadn't been tampered with in transit to the user's desktop.

However, all of this seemed nothing like as secure as the Java applet model, where security was built right into the architecture of the language. And yet, there is also some truth in Microsoft's contention, that for any interactivity within a browser to have any real seriousness there must be some possibility of the interaction writing to or reading from the hard disk: otherwise all you have is decoration, illustration, but nothing that can generate anything tangible. The fact that recent releases of Java have code signing provisions which allows security for certain "trusted" applets to be relaxed seems to confirm this.

And in many ways, downloading an ActiveX control to do things which are more customarily the preserve of applets, i.e. little navigation controls, scrolling banners, is a little absurd (though perplexingly widespread). In practice, ActiveX controls are mostly used now as a more flexible and global type of Plug-In which is to say, something that builds new and very sophisticated application specific functionality into a host application. For instance, if I download a Shockwave Plug-In it means I can view Director movies inside my browser. But just there! Inside my browser I can watch the odd movie. Great. However, if I install a Shockwave ActiveX control, it means I can view Director movies inside my Browser, Word Processor, inside PowerPoint, inside Excel if I really feel like it, and if I want some of the forms in my Access database to be exceptionally entertaining, well I can't view them there too! This is ultimately what the value of ActiveX is.

In education the use of ActiveX might be as follows. If I want a animation inside my presentation, I can do it as a Director Movie inside PowerPoint. Suppose in a more sophisticated way, I want to run a physical model of the atmosphere inside a CAL module which does a number of typical CAL things (quizzes etc) about meteorology. I could use Authorware for the typical CAL stuff and then write an ActiveX control in Visual Basic to do the more sophisticated simulations.

ActiveX currently runs very well on the Windows platform. However, since it belongs to a much larger development paradigm promoted by Microsoft, called COM (meaning Component Object Model), the porting of it to other platforms has not been completely straightforward. Microsoft currently has COM for Unix and Mac in varying states of readiness, though in practice we're along way from that achieved on the Win32 platform. For instance Authorware on a Mac cannot host Mac ActiveX controls yet (though Macromedia are working on it apparently).

Therefore, its still probably wise to be a bit suspicious about installing ActiveX controls, but if its from a reliable source (such as Macromedia or Real Networks for instance and you're using the Win32 platform) it might be a better choice than the corresponding Plug-In. However, all this is very contentious and goes right to the heart of the future of the Internet itself.

 

80,00% of 5 voters found this FAQ useful,  I found this FAQ  useful useful  not useful not useful



Powered by EasyFAQ © 2006 Joomla-addons.org