Could someone explain the diffence of a reference and a component? Both of these are found in the project menu.
Thanks.
Printable View
Could someone explain the diffence of a reference and a component? Both of these are found in the project menu.
Thanks.
I've always taken the simplistic view that "references" are pointers to external code (usually, but not always, .dll's) that may extend the IDE where "components" are add-ins that usually extend the IDE (usually, but not always, OCX's).
Here's what MSDN Help says for references:
Allows you to select another application's objects that you want available in your code by setting a reference to that application'sobject library.
And for components:
An ActiveX component is a unit of executable code, such as an .exe, .dll, or .ocx file, that follows the ActiveX specification for providing objects. ActiveX technology allows programmers to assemble these reusable software components into applications and services.
So if you reference an objectand you go to package up your program to distribute it, will everything your program needs to run be included...any dll files and such?
Or does it rely on the fact that the other computer that is running the program have those .dll files?
In short; Yes!
But it depends on the dependencies :)
You must have a dependency file for the DLL (or other COM objects you are referencing) otherwise the PDW wont know if the DLL is in need (depended) on other DLL files.
Normally you have all the dependency files you need, if you have a licens to distribute the COM object.
If not you must rely on that the file is installed on the computer that is running the application.
Take the Internet control for example. You are NOT allowed to distribute the ShDocVw.dll file by it self, so you wont have any dependency file on that one.
If you include and use it in your application the PDW will show a warning notice that the file lacks a dependency.
(You can only distribute the ShDocVw.dll by distributing the whole Internet Explorer application).
Best regards