Creation of activex document dll using visual basic and register it.

Posted on

Creation of activex doc dll utilizing visible primary and register it.

 

Intention : Creation of activex doc dll utilizing visible primary and register it.

Concept:

           

            Activex doc

                   Normal definition :

The best solution to describe an ActiveX doc is to name it a Visible Fundamental kind that seems inside a browser. Although not technically correct – it does will let you image what’s going on with ActiveX paperwork.

Technical defintion:

To be extra technically correct, an ActiveX doc is a structured storage file that’s displayed by an ActiveX part. The structured storage file is the VBD file you’ll have heard about and the ActiveX part is the ActiveX Doc EXE or ActiveX Doc DLL that you simply construct once you outline the ActiveX doc project.

                     .Exe versus .dll:

Visible Fundamental provides you the selection of making your                   ActiveX doc project as an .EXE or a DLL. The            variations between these lie in velocity and security. An .EXE runs “out of course of” with respect to its container (the browser), which implies that it has its personal reminiscence house. Communication between separate processes is slower, however as a result of the .EXE runs in its personal reminiscence house, it might probably crash with out inflicting the container to crash. A DLL runs “in course of,” sharing the identical reminiscence house because the container. Intra-process communication is so much sooner, however a bug within the DLL can crash the container. Functionally, there isn’t any distinction between .EXE and DLLÑyou choose one or the opposite relying on whether or not utmost velocity or crash safety is extra vital to you.

                Creation of Activex doc:

An ActiveX doc project is made up of a doc that incorporates the information, and a server, or software, that gives the performance. After compilation, the doc is contained in a Visible Fundamental Doc file (.VBD) and the server is contained in both an .EXE or .DLL file. Throughout growth, the project is in a .DOB file, which is a plain textual content file containing the definitions of the project’s controls, source code, and so forth. If an ActiveX doc project incorporates graphical parts that can not be saved in textual content format, they are going to be saved in a .DOX file. The .DOB and .DOX information in an ActiveX doc project are parallel to the .FRM and .FRX information of an everyday Visible Fundamental executable project.

         Deployment of activex doc:

What are the logistics of deploying an ActiveX doc? A deployment consists of 1 .VBD file for every doc within the project, plus a compressed CAB file containing the compiled DLL or .EXE file. The CAB file may additionally include the Visible Fundamental runtime and assist information, or you may specify that these be downloaded immediately from Microsoft’s website. This latter choice reduces the scale of your deployment however doesn’t take away the requirement that the Visible Fundamental runtime and assist information should be downloaded—solely as soon as, nevertheless—until the person already has these information on the native system. This requirement for support-file download is another excuse why ActiveX paperwork are extra appropriate for particular Internet-based functions and are much less appropriate for a basic “public” Internet web page.

    Navigation of activex Doc :

  When a person navigates to an ActiveX doc for the primary time, right here’s what occurs:

1.      The CAB file is downloaded.

2.      The .EXE or DLL that incorporates the server is extracted from the CAB file and put in on the system.

3.      If required, the Visible Fundamental runtime and assist information are put in, both from the CAB or from the Microsoft download website.

4.      The VBD file is both downloaded to the native pc or, extra typically, opened from the distant location.

Registration of .dll/.exe/.ocx :

                                 REGSVR32 is a command-line instrument that has a easy set of choices

REGSVR32 command-line choices.

Choice description:

/u Unregister the required COM server

/s Register the COM server silently (with no seen output)

                        /c Register the COM server with output to the console

The REGSVR32 instrument is used with the next command-line syntax:

                           regsvr32 filename.xxx

    Algorithm:

                     Itemizing 1. GetPathFromFullFileName


a>

   Public Operate GetPathFromFullFileName(FullFileName     As String) _
         As String
' Handed a completely certified filename, removes
' the filename half and returns the trail information.
' Returns a clean string if there isn't any path information.

b>Strip any areas.
 FullFileName = Trim(FullFileName)
' Examine for empty argument.
If Len(FullFileName) = zero Then
GetPathFromFullFileName = ""
Exit Operate
Finish If

c> Search for final / or .

 If Mid$(FullFileName, idx, 1) = "" Or _
Mid$(FullFileName, idx, 1) = "/" GetPathFromFullFileName = Left$(FullFileName, idx)

Itemizing 2. Code in UserDocument1

a>

Personal Sub UserDocument_InitProperties()
' Initialize the doc's two information gadgets.
 Finish Sub
b> path = GetPathFromFullFileName(UserDocument.Father or mother.LocationURL)

c>

Hyperlink.NavigateTo path & "UserDocument2.vbd"
d>

Personal Sub txtUserName_Change()
' Inform the container than a property has modified.
PropertyChanged "UserName"
e>

'Inform the container {that a} property has been modified.
PropertyChanged "UserComment"


f> UserDocument_ReadProperties(PropBag As PropertyBag)
' Learn the doc's two information gadgets from the property bag.
txtUserName.Textual content = PropBag.ReadProperty("UserName", "")
UserComment = PropBag.ReadProperty("UserComment", "")

g>

  UserDocument_WriteProperties(PropBag As PropertyBag)
' Write the doc's two information gadgets to the property bag.
PropBag.WriteProperty "UserComment", UserComment
PropBag.WriteProperty "UserName", txtUserName.Textual content

Itemizing 3. Code in UserDocument2

a>

Personal Sub cmdGoBack_Click()
Hyperlink.GoBack
Finish Sub                     

Conclusion:      

lastly , now we have carried out the task efficiently with understanding of primary options of acitvex doc dll & creation of it utilizing visible primary and on the final we register it.

 

Supply projectgeek.com