How to make a COMponent to allow other apps access to my app's functions

Posted on 2006-04-01
Last Modified: 2010-04-23
I have written a complete application in VB.Net.  Assuming I have a form: 'frmNewFolders' which contains a Function which creates 5 new folders in the directory named: strDirectoryLocation (a private variable declared in that form).  (The value of the 'strDirectoryLocation' string is set elsewhere within the application.)

How do I create a dll in order to access that form's 'CreateFolders' function?
Does the private variable strDirectoryLocation need to be declared as a Public variable before it will be accessible to other applications?
If someone has already installed my application, if I send them the necessary dll file what must they do to get the dll file to be recognised by their system/available to their other applications?
Question by:Sigh_Man
    1 Comment
    LVL 96

    Accepted Solution

    1) If you have a public class in a DLL, then all members that you want to expose to the world must be Public to be accessible.

    2) If someone gets your DLL, then all they need to do is have a reference to that project.

    3) If you are creating reusable code in DLL's for other developers to use, then use attributes (and code comments where available) to help them.  An example of an attribute would be the Description

    <Description("This method gets an array of files from the specified full path.")> _
    Public Function GetFolders(ByVal path As String) As String()
    End Sub


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now