PDA

Click to See Complete Forum and Search --> : ActiveX questions


Marky dude
Nov 5th, 2003, 07:52 AM
Hi all,

I am a newbie when it comes to ActiveX programming as you will definitely notice when reading my questions below. I have read lots of stuff about ActiveX but all the terminology makes my head spin and I cannot seem to put my finger on it. Below I have listed some questions and I would appreciate if someone could answer them.

If you can give me links to certain sites that are useful for newbies please don't hesitate to mention them as well.

1. What is exactly the difference between an ActiveX control and an ActiveX component?

2. What is an ActiveX Server Component compared to a ‘normal’ ActiveX component?

3. When should I choose to develop an ActiveX component (or control) instead of a normal COM component?

4. I have read that an ActiveX control is something you download and automatically gets installed whenever Internet Explorer hits a site that uses an ActiveX control. Is this correct and, if so, how does this differ than with an ActiveX component?

5. Any COM component needs to have the IDispatch interface implemented before it can be used in a HTML page using for instance JScript [y|n]?

6. Any COM component that implements the IDispatch interface can be considered an ActiveX component [y|n]?

7. If the answer to the previous question is negative; what is the difference between an ActiveX component and a COM component that has IDispatch implemented?

8. ActiveX Components can either be an EXE or a DLL. I have read somewhere that an EXE is used for DCOM (out-of-process & beyond one machine) and a DLL within an in-process application. Is this correct [y|n]?

9. When do I select “Simple Object” and when “Active Server Component” in the ATL Object Wizard of Visual C++?

Kind regards,
Mark

si_the_geek
Nov 5th, 2003, 08:34 AM
a few answers (don't take this as gospel, it is only from memory!):

1. An ActiveX control is basically like a normal control (eg: textbox) that can be placed on a form, and treated in the same way (although it may have extra functions).

An ActiveX component is a DLL or EXE file that contains code (functions/subs/classes) that a program can use.

2. I think Server means EXE and 'normal' is DLL.
An EXE runs only one copy, no matter how many references are made to it; A new copy of a DLL is created for each reference.


4. True. DLL's/EXE's cant be embedded in web pages (but can be used server side in ASP pages).


8. No, an EXE can be used for anything. (in process & out of process just means what I said for 2). ps: I think DCOM will need a EXE, but I've never used DCOM.

Maven
Nov 5th, 2003, 11:53 AM
1. An activex component is a compiled program with sets of functions required by com. In visual basic you can use exe's or dll files to create components. An Active X Control is something ment for your toolbox, think of the text box control for example. Its not a ture component but it has many of the same features.

2. Active X EXE controls are out of process servers, Active X Dll Files are In process servers. A active x control I suppose would be the normal (It runs in process btw) =P

3. ActiveX in a nutshell is com. You want to develop controls when you want to make something like the text box control or maybe the command button. The dll files and exe files are useful for devloping everything else. Basically if you need in process components then you would want to make a dll file. For example if you would like to safely subclass a control, it would be best to do so in a dll. The Active X exe's are good when you need to go out of process.

4. Yes but it is IE only and most smart people turn that feature off because the threat of infecting your computer with a virus. An activex document would probably be better for the purpose of working with the browser.

5. Yes it does, its called late binding. It allows authors to reference the function by name instead of having to use the location of the function in the vtable.

6. No. I think what your thinking of is IUnkown. Basically com rules states that an object isn't a com unless its definition is derived from IUnknown.

7. ActiveX in a nutshell is com. Basically all active x is, is a wrapper around it.

8. Already answered above.

9. LOL basically the name says it all... when you want somehting simple... select simple object =P All the wizard does is generate some code to keep you from typing a bunch of standard in every program ****.